summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorElan Ruusamäe2009-05-24 16:16:15 (GMT)
committercvs2git2012-06-24 12:13:13 (GMT)
commitf3d8af28bb2067137b4652f7f9ac649816be2719 (patch)
treeeb444e886c7e46c82913282bc97395c832dd1c36
parent22b73cd639280c0474a6baf57632e86d6dab39e0 (diff)
downloadpostfix-f3d8af28bb2067137b4652f7f9ac649816be2719.zip
postfix-f3d8af28bb2067137b4652f7f9ac649816be2719.tar.gz
Changed files: postfix.init -> 1.27
-rw-r--r--postfix.init82
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
}