]> git.pld-linux.org Git - packages/postfix.git/blobdiff - postfix.init
- added german bounce templates
[packages/postfix.git] / postfix.init
index 05196df73d947ef9f86110c0e0efe25cefe50499..10671edc7f84a05366fc0f25f22b123bc9c198b5 100644 (file)
@@ -5,7 +5,7 @@
 #
 # chkconfig:   345 80 30
 #
-# description: Postfix is a Mail Transport Agent, which is the program
+# description: Postfix is a Mail Transport Agent, which is the program \
 #              that moves mail from one machine to another.
 
 
@@ -20,7 +20,7 @@
 
 # Check that networking is up.
 if is_yes "${NETWORKING}"; then
-       if [ ! -f /var/lock/subsys/network ]; then
+       if [ ! -f /var/lock/subsys/network -a "$1" != stop -a "$1" != status ]; then
                msg_network_down Postfix
                exit 1
        fi
@@ -28,7 +28,7 @@ else
        exit 0
 fi
 
-
+RETVAL=0
 # See how we were called.
 case "$1" in
   start)
@@ -37,16 +37,16 @@ case "$1" in
                msg_starting Postfix
                busy
                MSG="`/usr/sbin/postfix start 2>&1`"
-               if [ "$?" = "0" ] ; then
+               if [ $? -eq 0 ]; then
                        ok
                        touch /var/lock/subsys/postfix
                else
+                       RETVAL=1
                        fail
                        echo "$MSG"
                fi
        else
                msg_already_running Postfix
-               exit 1
        fi
        ;;
   stop)
@@ -55,8 +55,7 @@ case "$1" in
                msg_stopping Postfix
                busy
                MSG="`/usr/sbin/postfix stop 2>&1`"
-               RETVAL=$?
-               if [ $RETVAL -eq 0 ]; then
+               if [ $? -eq 0 ]; then
                        ok
                else
                        fail
@@ -65,23 +64,22 @@ case "$1" in
                rm -f /var/lock/subsys/postfix
        else
                msg_not_running Postfix
-               exit 1
        fi
        ;;
   restart)
        $0 stop
        $0 start
+       exit $?
        ;;
-  reload)
+  reload|force-reload)
        if [ -f /var/lock/subsys/postfix ]; then
                msg_reloading Postfix
-               busy
-               /usr/sbin/postfix reload
+               daemon /usr/sbin/postfix reload
                RETVAL=$?
-               [ $RETVAL -eq 0 ] && ok || died
+               [ $RETVAL -ne 0 ] && RETVAL=7
        else
                msg_not_running Postfix
-               exit 1
+               exit 7
        fi
        ;;
   status)
@@ -93,15 +91,15 @@ case "$1" in
        extra_db=$(ls -1 /etc/mail/*.db 2> /dev/null | grep -v aliases.db | sed -e 's#.db$##')
        for base in $standard_db $extra_db; do
                I=$(basename "$base")
-               if [ -f /etc/mail/$I ] ; then
+               if [ -f /etc/mail/$I ]; then
                        /usr/sbin/postmap hash:/etc/mail/$I < /etc/mail/$I
                fi
        done
        /usr/bin/newaliases
        ;;
   *)
-       msg_usage "$0 {start|stop|restart|reload|rebuilddb|status}"
-       exit 1
+       msg_usage "$0 {start|stop|restart|reload|force-reload|rebuilddb|status}"
+       exit 3
 esac
 
 exit $RETVAL
This page took 0.062209 seconds and 4 git commands to generate.