#
# 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.
# 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
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