]> git.pld-linux.org Git - packages/postfix.git/blobdiff - postfix.init
- up to 3.5.0
[packages/postfix.git] / postfix.init
index 2f2c3fe6614e5a622d0cdcc6de3dfda1832fea55..c44be2f67004641c112efc5927f2727d7c4c410d 100644 (file)
@@ -31,59 +31,62 @@ networking_check() {
 }
 
 start() {
-       local msg
+       if [ -f /var/lock/subsys/postfix ]; then
+               msg_already_running "Postfix"
+               return
+       fi
 
-       if [ ! -f /var/lock/subsys/postfix ]; then
-               msg_starting "Postfix"
-               busy
-               msg=$(/usr/sbin/postfix start 2>&1)
-               RETVAL=$?
-               if [ $RETVAL -eq 0 ]; then
-                       ok
-                       touch /var/lock/subsys/postfix
-               else
-                       fail
-                       echo >&2 "$msg"
-               fi
+       local msg
+       msg_starting "Postfix"
+       busy
+       _daemon_set_ulimits
+       msg=$(nice -n ${SERVICE_RUN_NICE_LEVEL:-${DEFAULT_SERVICE_RUN_NICE_LEVEL:-0}} /usr/sbin/postfix start 2>&1)
+       RETVAL=$?
+       if [ $RETVAL -eq 0 ]; then
+               ok
+               touch /var/lock/subsys/postfix
        else
-               msg_already_running "Postfix"
+               fail
+               echo >&2 "$msg"
        fi
 }
 
 stop() {
+       if [ ! -f /var/lock/subsys/postfix ]; then
+               msg_not_running "Postfix"
+               return
+       fi
+
        local msg
-       if [ -f /var/lock/subsys/postfix ]; then
-               msg_stopping "Postfix"
-               busy
-               msg=$(/usr/sbin/postfix stop 2>&1)
-               if [ $? -eq 0 ]; then
-                       ok
-               else
-                       fail
-                       echo >&2 "$msg"
-               fi
-               rm -f /var/lock/subsys/postfix
+       msg_stopping "Postfix"
+       busy
+       msg=$(/usr/sbin/postfix stop 2>&1)
+       if [ $? -eq 0 ]; then
+               ok
        else
-               msg_not_running "Postfix"
+               fail
+               echo >&2 "$msg"
        fi
+       rm -f /var/lock/subsys/postfix >/dev/null 2>&1
 }
 
 reload() {
+       if [ ! -f /var/lock/subsys/postfix ]; then
+               msg_not_running "Postfix"
+               RETVAL=7
+               return
+       fi
+
        local msg
-       if [ -f /var/lock/subsys/postfix ]; then
-               msg_reloading "Postfix"
-               busy
-               msg=$(/usr/sbin/postfix reload 2>&1)
-               RETVAL=$?
-               if [ $RETVAL -eq 0 ]; then
-                       ok
-               else
-                       fail
-                       echo >&2 "$msg"
-                       RETVAL=7
-               fi
+       msg_reloading "Postfix"
+       busy
+       msg=$(/usr/sbin/postfix reload 2>&1)
+       RETVAL=$?
+       if [ $RETVAL -eq 0 ]; then
+               ok
        else
-               msg_not_running "Postfix"
+               fail
+               echo >&2 "$msg"
                RETVAL=7
        fi
 }
@@ -109,7 +112,7 @@ case "$1" in
        ;;
   rebuilddb)
        standard_db="access canonical relocated transport virtual"
-       extra_db=$(ls -1 /etc/mail/*.db 2> /dev/null | egrep -v '/(access|canonical|relocated|transport|virtual|aliases)\.db$')
+       extra_db=$(ls -1 /etc/mail/*.db 2> /dev/null | grep -Ev '/(access|canonical|relocated|transport|virtual|aliases)\.db$')
 
        echo -n "Rebuilding databases: "
        for base in $standard_db $extra_db; do
This page took 0.046676 seconds and 4 git commands to generate.