}
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
}