3 # postfix This shell script takes care of starting and stopping
6 # chkconfig: 2345 80 30
8 # description: Postfix is a Mail Transport Agent, which is the program
9 # that moves mail from one machine to another.
12 # Source function library
13 . /etc/rc.d/init.d/functions
16 . /etc/sysconfig/network
19 [ -f /etc/sysconfig/postfix ] && . /etc/sysconfig/postfix
21 # Check that networking is up.
22 [ "${NETWORKING}" = "no" ] && echo "Error: Networking is down"; exit 0
25 # See how we were called.
28 # Check if the service is already running?
29 if [ ! -f /var/lock/subsys/postfix ]; then
34 if /usr/sbin/postfix start 2>/dev/null; then
40 echo "postfix already is running"
42 touch /var/lock/subsys/postfix
46 show "Shutting down postfix: "
48 if /usr/sbin/postfix stop 2>/dev/null; then
53 rm -f /var/lock/subsys/postfix
60 /usr/sbin/postfix reload
66 for I in access canonical relocated transport virtual; do
67 if [ -f /etc/mail/$I ] ; then
68 /usr/sbin/postmap hash:/etc/mail/$I < /etc/mail/$I
73 echo "Usage: $0 {start|stop|status|restart|reload|rebuilddb}"