diff options
author | Elan Ruusamäe | 2009-05-24 16:16:15 (GMT) |
---|---|---|
committer | cvs2git | 2012-06-24 12:13:13 (GMT) |
commit | f3d8af28bb2067137b4652f7f9ac649816be2719 (patch) | |
tree | eb444e886c7e46c82913282bc97395c832dd1c36 | |
parent | 22b73cd639280c0474a6baf57632e86d6dab39e0 (diff) | |
download | postfix-f3d8af28bb2067137b4652f7f9ac649816be2719.zip postfix-f3d8af28bb2067137b4652f7f9ac649816be2719.tar.gz |
- cosmeticauto/ac/postfix-2_5_7-1
Changed files:
postfix.init -> 1.27
-rw-r--r-- | postfix.init | 82 |
1 files changed, 42 insertions, 40 deletions
diff --git a/postfix.init b/postfix.init index e9388aa..a446c08 100644 --- a/postfix.init +++ b/postfix.init @@ -31,60 +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 - _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 - 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 } 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 } |