- force-reload is not supposed to start service if not running
- added try-reload action (LSB 3.1)
Changed files:
anubis.init -> 1.8
# Get service config
[ -f "/etc/sysconfig/$SERVICE" ] && . "/etc/sysconfig/$SERVICE"
-RETVAL=0
-# See how we were called.
-case "$1" in
- start)
+start() {
if [ ! -f "$LOCKFILE" ]; then
msg_starting "$MSG"
daemon $PROG
else
msg_already_running $MSG
fi
- ;;
- stop)
+}
+
+stop() {
if [ -f "$LOCKFILE" ]; then
msg_stopping "$MSG"
killproc $PROG
else
msg_not_running "$MSG"
fi
+}
+
+condrestart() {
+ if [ -f "$LOCKFILE" ]; then
+ stop
+ start
+ else
+ msg_not_running "$MSG"
+ RETVAL=$1
+ fi
+}
+
+RETVAL=0
+# See how we were called.
+case "$1" in
+ start)
+ start
+ ;;
+ stop)
+ stop
+ ;;
+ restart)
+ stop
+ start
+ ;;
+ try-restart)
+ condrestart 0
+ ;;
+ force-reload)
+ condrestart 7
;;
status)
status $PROG
exit $?
;;
- restart|force-reload)
- $0 stop
- $0 start
- exit $?
- ;;
*)
msg_usage "$0 {start|stop|restart|force-reload|status}"
exit 3