From 648b7437de3ea4319bbadd63a94ec6ffeb6cd409 Mon Sep 17 00:00:00 2001 From: =?utf8?q?Elan=20Ruusam=C3=A4e?= Date: Mon, 29 Sep 2008 13:03:40 +0000 Subject: [PATCH] - add try-restart, correct force-reload Changed files: cancd.init -> 1.5 --- cancd.init | 20 ++++++++++++++++++-- 1 file changed, 18 insertions(+), 2 deletions(-) diff --git a/cancd.init b/cancd.init index e81b7b6..3ff36e5 100644 --- a/cancd.init +++ b/cancd.init @@ -51,6 +51,16 @@ stop() { fi } +condrestart() { + if [ -f /var/lock/subsys/cancd ]; then + stop + start + else + msg_not_running cancd + RETVAL=$1 + fi +} + RETVAL=0 # See how we were called. case "$1" in @@ -60,16 +70,22 @@ case "$1" in stop) stop ;; - restart|force-reload) + restart) stop start ;; + try-restart) + condrestart 0 + ;; + force-reload) + condrestart 7 + ;; status) status cancd RETVAL=$? ;; *) - msg_usage "$0 {start|stop|restart|force-reload|status}" + msg_usage "$0 {start|stop|restart|try-restart|force-reload|status}" exit 3 esac -- 2.43.0