]> git.pld-linux.org Git - packages/net-snmp.git/commitdiff
- added try-restart
authorJakub Bogusz <qboosh@pld-linux.org>
Tue, 4 Nov 2008 22:07:03 +0000 (22:07 +0000)
committercvs2git <feedback@pld-linux.org>
Sun, 24 Jun 2012 12:13:13 +0000 (12:13 +0000)
- force-reload=reload

Changed files:
    net-snmpd.init -> 1.17

net-snmpd.init

index 0e93328c5d015814178ce7ae7ef1ffbb9d5c558c..f3f68dce2957a2edddff7bd69cac99208dce68be 100644 (file)
@@ -63,6 +63,16 @@ stop() {
        fi
 }
 
+condrestart() {
+       if [ -f /var/lock/subsys/snmpd ]; then
+               stop
+               start
+       else
+               msg_not_running "snmpd"
+               RETVAL=$1
+       fi
+}
+
 RETVAL=0
 # See how we were called.
 case "$1" in
@@ -72,7 +82,14 @@ case "$1" in
   stop)
        stop
        ;;
-  reload)
+  restart)
+       stop
+       start
+       ;;
+  try-restart)
+       condrestart 0
+       ;;
+  reload|force-reload)
        if [ -f /var/lock/subsys/snmpd ]; then
                msg_reloading "snmpd"
                killproc snmpd -HUP
@@ -80,16 +97,12 @@ case "$1" in
                msg_not_running "snmpd"
        fi
        ;;
-  restart|force-reload)
-       stop
-       start
-       ;;
   status)
        status snmpd
        exit $?
        ;;
   *)
-       msg_usage "$0 {start|stop|reload|restart|force-reload|status}"
+       msg_usage "$0 {start|stop|restart|try-restart|reload|force-reload|status}"
        exit 3
 esac
 
This page took 0.064404 seconds and 4 git commands to generate.