]> git.pld-linux.org Git - packages/dbus.git/blobdiff - messagebus.init
- use -lcap where needed only
[packages/dbus.git] / messagebus.init
index 183119415255101d97d3d22cb1131c4fb6812972..d877103755cfc0dd41c61c4d06a1536d253aa4d4 100644 (file)
@@ -25,57 +25,55 @@ 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
+               dbus-uuidgen --ensure
                daemon dbus-daemon --system
                RETVAL=$?
                [ $RETVAL -eq 0 ] && touch /var/lock/subsys/messagebus
        else
                msg_already_running messagebus
        fi
-       ;;
-  stop)
+}
+
+stop() {
        if [ -f /var/lock/subsys/messagebus ]; then
                # Stop daemons.
                msg_stopping messagebus
-               killproc --pidfile dbus.pid
+               killproc --pidfile dbus.pid dbus-daemon
                rm -f /var/lock/subsys/messagebus
                rm -f /var/run/dbus.pid
        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
                RETVAL=$?
        else
-               msg_not_running messagebus >&2
+               msg_not_running messagebus
                RETVAL=7
        fi
        ;;
-  force-reload)
-       # if program allows reloading without stopping
-       $0 reload
-
-       # or if it doesn't
-       $0 restart
-
-       exit $?
-       ;;
   status)
-       status messagebus
+       status messagebus dbus-daemon
        RETVAL=$?
        ;;
   *)
@@ -86,4 +84,3 @@ esac
 exit $RETVAL
 
 # This must be last line !
-# vi:syntax=sh:tw=78:ts=8:sw=4
This page took 0.053775 seconds and 4 git commands to generate.