]> git.pld-linux.org Git - packages/dbus.git/blobdiff - messagebus.init
- updated for 1.2.20
[packages/dbus.git] / messagebus.init
index d4a1162c5286822a7f82a5f8ab9ddce3bc37bd21..7d4dcc92fc402c0f26871267c80008cca00f9b5a 100644 (file)
@@ -2,7 +2,7 @@
 #
 # messagebus   The D-BUS systemwide message bus
 #
-# chkconfig:   345 97 03
+# chkconfig:   345 22 85
 #
 # description: This is a daemon which broadcasts notifications of system
 #              events and other messages.
@@ -18,7 +18,6 @@
 # Check that networking is up.
 if is_yes "${NETWORKING}"; then
        if [ ! -f /var/lock/subsys/network ]; then
-               # nls "ERROR: Networking is down. %s can't be run." messagebus
                msg_network_down messagebus
                exit 1
        fi
@@ -26,72 +25,78 @@ 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
-               # show "Starting %s service" messagebus
                msg_starting messagebus
-               daemon dbus-daemon --system
+               # 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=$?
                [ $RETVAL -eq 0 ] && touch /var/lock/subsys/messagebus
        else
-               # show "%s service is already running." messagebus
                msg_already_running messagebus
        fi
-       ;;
-  stop)
+}
+
+stop() {
        if [ -f /var/lock/subsys/messagebus ]; then
                # Stop daemons.
-               # show "Stopping %s service" messagebus
                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
-               # show "%s service is not running." messagebus
                msg_not_running messagebus
        fi
+}
+
+condrestart() {
+       if [ -f /var/lock/subsys/cpqarrayd ]; then
+               stop
+               start
+       else
+               msg_not_running messagebus
+               RETVAL=$1
+       fi
+}
+
+RETVAL=0
+# See how we were called.
+case "$1" in
+  start)
+       start
+       ;;
+  stop)
+       stop
        ;;
   restart)
-       $0 stop
-       $0 start
-       exit $?
+       stop
+       start
+       ;;
+  try-restart)
+       condrestart 0
        ;;
-  reload)
+  reload|force-reload)
        if [ -f /var/lock/subsys/messagebus ]; then
-               # show "Reload %s service" messagebus
                msg_reloading messagebus
                killproc dbus-daemon -HUP
                RETVAL=$?
        else
-               # show "%s service is not running." messagebus
-               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=$?
        ;;
   *)
-       # show "Usage: %s {start|stop|restart|reload|force-reload|status}"
-       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:tw=78:ts=8:sw=4
This page took 0.069397 seconds and 4 git commands to generate.