]> git.pld-linux.org Git - packages/dbus.git/blobdiff - messagebus.init
- updated to 1.4.6
[packages/dbus.git] / messagebus.init
index b01287e817820b73fc0a435126c3ce79531b2ad9..4aa87210aff98c6f4790b10e6c1e75d70ddea280 100644 (file)
@@ -18,7 +18,7 @@
 # Check that networking is up.
 if is_yes "${NETWORKING}"; then
        if [ ! -f /var/lock/subsys/network ]; then
-               msg_network_down messagebus
+               msg_network_down "D-BUS Message bus"
                exit 1
        fi
 else
@@ -27,43 +27,65 @@ fi
 
 start() {
        # Check if the service is already running?
-       if [ ! -f /var/lock/subsys/messagebus ]; then
-               msg_starting messagebus
-               # if capability is modular, load it
-               if modinfo capability >/dev/null 2>&1; then
-                       modprobe -s capability
-               fi
-               dbus-uuidgen --ensure
-               daemon dbus-daemon --system
-               RETVAL=$?
-               [ $RETVAL -eq 0 ] && touch /var/lock/subsys/messagebus
-       else
-               msg_already_running messagebus
+       if [ -f /var/lock/subsys/messagebus ]; then
+               msg_already_running "D-BUS Message bus"
+               return
+       fi
+
+       emit starting JOB=messagebus
+       msg_starting "D-BUS Message bus"
+       # if capability is modular, load it
+       if modinfo capability >/dev/null 2>&1; then
+               modprobe -s capability
+       fi
+       dbus-uuidgen --ensure
+       daemon --pidfile dbus.pid /usr/bin/dbus-daemon --system
+       RETVAL=$?
+       if [ $RETVAL -eq 0 ] ; then
+               touch /var/lock/subsys/messagebus
+               emit --no-wait started JOB=messagebus
        fi
 }
 
 stop() {
-       if [ -f /var/lock/subsys/messagebus ]; then
-               # Stop daemons.
-               msg_stopping messagebus
-               killproc --pidfile dbus.pid dbus-daemon
-               rm -f /var/lock/subsys/messagebus
-               rm -f /var/run/dbus.pid
-       else
-               msg_not_running messagebus
+       if [ ! -f /var/lock/subsys/messagebus ]; then
+               msg_not_running "D-BUS Message bus"
+               return
        fi
+
+       # Stop daemons.
+       emit stopping JOB=messagebus
+       msg_stopping "D-BUS Message bus"
+       killproc --pidfile dbus.pid dbus-daemon
+       rm -f /var/lock/subsys/messagebus /var/run/dbus.pid
+       emit --no-wait stopped JOB=messagebus
 }
 
 condrestart() {
-       if [ -f /var/lock/subsys/cpqarrayd ]; then
-               stop
-               start
-       else
-               msg_not_running cpqarrayd
+       if [ ! -f /var/lock/subsys/messagebus ]; then
+               msg_not_running "D-BUS Message bus"
                RETVAL=$1
+               return
        fi
+
+       stop
+       start
 }
 
+reload() {
+       if [ ! -f /var/lock/subsys/messagebus ]; then
+               msg_not_running "D-BUS Message bus"
+               RETVAL=7
+               return
+       fi
+
+       msg_reloading "D-BUS Message bus"
+       killproc --pidfile dbus.pid dbus-daemon -HUP
+       RETVAL=$?
+}
+
+upstart_controlled
+
 RETVAL=0
 # See how we were called.
 case "$1" in
@@ -81,17 +103,10 @@ case "$1" in
        condrestart 0
        ;;
   reload|force-reload)
-       if [ -f /var/lock/subsys/messagebus ]; then
-               msg_reloading messagebus
-               killproc dbus-daemon -HUP
-               RETVAL=$?
-       else
-               msg_not_running messagebus
-               RETVAL=7
-       fi
+       reload
        ;;
   status)
-       status messagebus dbus-daemon
+       status --pidfile dbus.pid messagebus dbus-daemon
        RETVAL=$?
        ;;
   *)
@@ -100,5 +115,3 @@ case "$1" in
 esac
 
 exit $RETVAL
-
-# This must be last line !
This page took 0.063243 seconds and 4 git commands to generate.