From ae3e1bf53d693ce8011c8dbc551024d0d8038603 Mon Sep 17 00:00:00 2001 From: =?utf8?q?Elan=20Ruusam=C3=A4e?= Date: Mon, 12 May 2008 22:36:13 +0000 Subject: [PATCH] - implement properly (according to template.init from rc-scripts) Changed files: amavis-stats.init -> 1.4 --- amavis-stats.init | 20 ++++++++++++++++++-- 1 file changed, 18 insertions(+), 2 deletions(-) diff --git a/amavis-stats.init b/amavis-stats.init index c0d8aa5..fd58d71 100644 --- a/amavis-stats.init +++ b/amavis-stats.init @@ -47,6 +47,16 @@ stop() { fi } +condrestart() { + if [ -f /var/lock/subsys/amavis-stats ]; then + stop + start + else + msg_not_running "Amavis Stats" + RETVAL=$1 + fi +} + RETVAL=0 # See how we were called. case "$1" in @@ -56,16 +66,22 @@ case "$1" in stop) stop ;; - restart|reload|force-restart|force-reload) + restart) stop start ;; + try-restart) + condrestart 0 + ;; + force-reload) + condrestart 7 + ;; status) status amavis-stats exit $? ;; *) - msg_usage "$0 {start|stop|restart|reload|force-restart|force-reload|status}" + msg_usage "$0 {start|stop|restart|try-restart|force-reload|status}" exit 3 esac -- 2.44.0