]> git.pld-linux.org Git - packages/hal.git/commitdiff
- add try-restart
authorElan Ruusamäe <glen@pld-linux.org>
Sun, 27 Apr 2008 00:59:02 +0000 (00:59 +0000)
committercvs2git <feedback@pld-linux.org>
Sun, 24 Jun 2012 12:13:13 +0000 (12:13 +0000)
Changed files:
    haldaemon.init -> 1.11

haldaemon.init

index f372be458deb1efb4fa1a12fbed52c4407f63f12..5a887b526eba1049215efc2d35b6fb8196067fc5 100644 (file)
@@ -8,6 +8,7 @@
 #               about hardware from several sources. \
 #               See http://www.freedesktop.org/software/hal
 #
+# $Id$
 
 
 # Source function library
@@ -49,6 +50,27 @@ stop() {
        fi
 }
 
+condrestart() {
+       if [ -f /var/lock/subsys/haldaemon ]; then
+               stop
+               start
+       else
+               msg_not_running haldaemon
+               RETVAL=$1
+       fi
+}
+
+reload() {
+       if [ -f /var/lock/subsys/haldaemon ]; then
+               msg_reloading haldaemon
+               killproc hald -HUP
+               RETVAL=$?
+       else
+               msg_not_running haldaemon
+               RETVAL=7
+       fi
+}
+
 # See how we were called.
 case "$1" in
   start)
@@ -61,26 +83,19 @@ case "$1" in
        stop
        start
        ;;
+  try-restart)
+       condrestart 0
+       ;;
   reload|force-reload)
-       if [ -f /var/lock/subsys/haldaemon ]; then
-               msg_reloading haldaemon
-               killproc hald -HUP
-               RETVAL=$?
-       else
-               msg_not_running haldaemon
-               RETVAL=7
-       fi
+       reload
        ;;
   status)
        status hald
        RETVAL=$?
        ;;
   *)
-       msg_usage "$0 {start|stop|restart|reload|force-reload|status}"
+       msg_usage "$0 {start|stop|restart|try-restart|reload|force-reload|status}"
        exit 3
 esac
 
 exit $RETVAL
-
-# This must be last line !
-# vi:syntax=sh
This page took 0.064355 seconds and 4 git commands to generate.