]> git.pld-linux.org Git - packages/postfix.git/blob - postfix.init
patches for postfix
[packages/postfix.git] / postfix.init
1 #!/bin/sh
2 #
3 # postfix       This shell script takes care of starting and stopping
4 #               postfix.
5 #
6 # chkconfig:    2345 80 30
7 #
8 # description:  Postfix is a Mail Transport Agent, which is the program
9 #               that moves mail from one machine to another.
10
11
12 # Source function library
13 . /etc/rc.d/init.d/functions
14
15 # Get network config
16 . /etc/sysconfig/network
17
18 # Get service config
19 [ -f /etc/sysconfig/postfix ] && . /etc/sysconfig/postfix
20
21 # See how we were called.
22 case "$1" in
23   start)
24         # Check if the service is already running?
25         if [ ! -f /var/lock/subsys/postfix ]; then
26                 show Starting postfix
27                 busy
28                 newaliases
29                 $0 rebuilddb
30                 if /usr/sbin/postfix start 2>/dev/null; then
31                         deltext; ok
32                 else
33                         deltext; fail
34                 fi
35         else
36                 echo "postfix already is running"
37         fi
38         touch /var/lock/subsys/postfix
39         ;;
40   stop)
41         # Stop daemons.
42         show "Shutting down postfix"
43         busy
44         if /usr/sbin/postfix stop 2>/dev/null; then
45                 deltext; ok
46         else
47                 deltext; fail
48         fi
49         rm -f /var/lock/subsys/postfix
50         ;;
51   restart)
52         $0 stop
53         $0 start
54         ;;
55   reload)
56         /usr/sbin/postfix reload
57         ;;
58   status)
59         status postfix
60         ;;
61   rebuilddb)
62         for I in access canonical relocated transport virtual; do
63                 if [ -f /etc/mail/$I ] ; then
64                         /usr/sbin/postmap hash:/etc/mail/$I < /etc/mail/$I
65                 fi
66         done
67         ;;
68   *)
69         echo "Usage: $0 {start|stop|status|restart|reload|rebuilddb}"
70         exit 1
71 esac
72
73 exit 0
This page took 0.060251 seconds and 4 git commands to generate.