]> git.pld-linux.org Git - packages/nagios-nrpe.git/commitdiff
- add try-restart, LSB 3.1 conformance
authorElan Ruusamäe <glen@pld-linux.org>
Tue, 9 Feb 2010 08:06:56 +0000 (08:06 +0000)
committercvs2git <feedback@pld-linux.org>
Sun, 24 Jun 2012 12:13:13 +0000 (12:13 +0000)
Changed files:
    nrpe.init -> 1.7

nrpe.init

index 8e217944e74b92dcb55e808052fd78ca374ce7c0..3161c7334e4dcaae031ce86f538d90f4f855a161 100644 (file)
--- a/nrpe.init
+++ b/nrpe.init
@@ -50,6 +50,17 @@ stop() {
        rm -f /var/lock/subsys/nrpe
 }
 
        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)
 RETVAL=0
 case "$1" in
   start)
@@ -58,16 +69,22 @@ case "$1" in
   stop)
        stop
        ;;
   stop)
        stop
        ;;
-  restart|force-reload)
+  restart)
        stop
        start
        ;;
        stop
        start
        ;;
+  try-restart)
+       condrestart 0
+       ;;
+  force-reload)
+       condrestart 7
+       ;;
   status)
        status nrpe
        exit $?
        ;;
   *)
   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
 
        exit 3
 esac
 
This page took 0.082181 seconds and 4 git commands to generate.