From 1d16747ebbbbcf9e09c79d9e7552161dcfad2c61 Mon Sep 17 00:00:00 2001 From: =?utf8?q?Elan=20Ruusam=C3=A4e?= Date: Tue, 9 Feb 2010 08:06:56 +0000 Subject: [PATCH] - add try-restart, LSB 3.1 conformance Changed files: nrpe.init -> 1.7 --- nrpe.init | 21 +++++++++++++++++++-- 1 file changed, 19 insertions(+), 2 deletions(-) diff --git a/nrpe.init b/nrpe.init index 8e21794..3161c73 100644 --- a/nrpe.init +++ b/nrpe.init @@ -50,6 +50,17 @@ stop() { rm -f /var/lock/subsys/nrpe } +condrestart() { + if [ ! -f /var/lock/subsys/nrpe ]; then + msg_not_running "Nagios NRPE daemon" + RETVAL=$1 + return + fi + + stop + start +} + RETVAL=0 case "$1" in start) @@ -58,16 +69,22 @@ case "$1" in stop) stop ;; - restart|force-reload) + restart) stop start ;; + try-restart) + condrestart 0 + ;; + force-reload) + condrestart 7 + ;; status) status nrpe exit $? ;; *) - echo "Usage: nrpe {start|stop|restart|force-reload|status}" + msg_usage "$0 {start|stop|restart|try-restart|force-reload|status}" exit 3 esac -- 2.43.0