]> git.pld-linux.org Git - packages/dbus.git/commitdiff
- use functions, fix force-reload
authorElan Ruusamäe <glen@pld-linux.org>
Sun, 1 Oct 2006 21:58:51 +0000 (21:58 +0000)
committercvs2git <feedback@pld-linux.org>
Sun, 24 Jun 2012 12:13:13 +0000 (12:13 +0000)
Changed files:
    messagebus.init -> 1.8

messagebus.init

index f591f165b6c49d9f117a87888acf9122d4136711..0c9d4f0d92b12fd5eef97faaf307769faeb4655a 100644 (file)
@@ -25,10 +25,7 @@ else
        exit 0
 fi
 
-
-# See how we were called.
-case "$1" in
-  start)
+start() {
        # Check if the service is already running?
        if [ ! -f /var/lock/subsys/messagebus ]; then
                msg_starting messagebus
@@ -38,8 +35,9 @@ case "$1" in
        else
                msg_already_running messagebus
        fi
-       ;;
-  stop)
+}
+
+stop() {
        if [ -f /var/lock/subsys/messagebus ]; then
                # Stop daemons.
                msg_stopping messagebus
@@ -49,13 +47,21 @@ case "$1" in
        else
                msg_not_running messagebus
        fi
+}
+
+# See how we were called.
+case "$1" in
+  start)
+       start
+       ;;
+  stop)
+       stop
        ;;
   restart)
-       $0 stop
-       $0 start
-       exit $?
+       stop
+       start
        ;;
-  reload)
+  reload|force-reload)
        if [ -f /var/lock/subsys/messagebus ]; then
                msg_reloading messagebus
                killproc dbus-daemon -HUP
@@ -65,15 +71,6 @@ case "$1" in
                RETVAL=7
        fi
        ;;
-  force-reload)
-       # if program allows reloading without stopping
-       $0 reload
-
-       # or if it doesn't
-       $0 restart
-
-       exit $?
-       ;;
   status)
        status messagebus dbus-daemon
        RETVAL=$?
@@ -86,4 +83,3 @@ esac
 exit $RETVAL
 
 # This must be last line !
-# vi:syntax=sh:tw=78:ts=8:sw=4
This page took 0.080918 seconds and 4 git commands to generate.