2007-01-14 04:45:06 +01:00
|
|
|
#!/bin/sh
|
|
|
|
#
|
|
|
|
# messagebus: The D-BUS systemwide message bus
|
|
|
|
#
|
|
|
|
# chkconfig: 345 97 03
|
|
|
|
# description: This is a daemon which broadcasts notifications of system events \
|
|
|
|
# and other messages. See http://www.freedesktop.org/software/dbus/
|
|
|
|
#
|
|
|
|
# processname: dbus-daemon
|
2020-07-17 23:55:20 +02:00
|
|
|
# pidfile: /run/messagebus.pid
|
2007-01-14 04:45:06 +01:00
|
|
|
#
|
|
|
|
|
|
|
|
# Create needed directories.
|
2020-07-17 23:55:20 +02:00
|
|
|
[ -d /run/dbus ] || mkdir -p /run/dbus
|
2007-01-14 04:45:06 +01:00
|
|
|
[ -d /var/lock/subsys ] || mkdir -p /var/lock/subsys
|
2009-03-23 10:44:07 +01:00
|
|
|
[ -d /tmp/dbus ] || mkdir -p /tmp/dbus
|
2007-01-14 04:45:06 +01:00
|
|
|
|
|
|
|
RETVAL=0
|
|
|
|
|
|
|
|
start() {
|
2015-10-03 23:29:57 +02:00
|
|
|
printf "Starting system message bus: "
|
2007-01-14 04:45:06 +01:00
|
|
|
|
2007-11-23 14:21:15 +01:00
|
|
|
dbus-uuidgen --ensure
|
2007-01-14 04:45:06 +01:00
|
|
|
dbus-daemon --system
|
|
|
|
RETVAL=$?
|
|
|
|
echo "done"
|
|
|
|
[ $RETVAL -eq 0 ] && touch /var/lock/subsys/dbus-daemon
|
|
|
|
}
|
|
|
|
|
|
|
|
stop() {
|
2015-10-03 23:29:57 +02:00
|
|
|
printf "Stopping system message bus: "
|
2007-01-14 04:45:06 +01:00
|
|
|
|
|
|
|
## we don't want to kill all the per-user $processname, we want
|
|
|
|
## to use the pid file *only*; because we use the fake nonexistent
|
|
|
|
## program name "$servicename" that should be safe-ish
|
|
|
|
killall dbus-daemon
|
|
|
|
RETVAL=$?
|
|
|
|
echo "done"
|
|
|
|
if [ $RETVAL -eq 0 ]; then
|
|
|
|
rm -f /var/lock/subsys/dbus-daemon
|
2020-07-17 23:55:20 +02:00
|
|
|
rm -f /run/messagebus.pid
|
2007-01-14 04:45:06 +01:00
|
|
|
fi
|
|
|
|
}
|
|
|
|
|
|
|
|
# See how we were called.
|
|
|
|
case "$1" in
|
|
|
|
start)
|
|
|
|
start
|
|
|
|
;;
|
|
|
|
stop)
|
|
|
|
stop
|
|
|
|
;;
|
|
|
|
restart)
|
|
|
|
stop
|
|
|
|
start
|
|
|
|
;;
|
|
|
|
condrestart)
|
|
|
|
if [ -f /var/lock/subsys/$servicename ]; then
|
|
|
|
stop
|
|
|
|
start
|
|
|
|
fi
|
|
|
|
;;
|
|
|
|
reload)
|
|
|
|
echo "Message bus can't reload its configuration, you have to restart it"
|
|
|
|
RETVAL=$?
|
|
|
|
;;
|
|
|
|
*)
|
2017-02-01 21:48:42 +01:00
|
|
|
echo "Usage: $0 {start|stop|restart|condrestart|reload}"
|
2007-01-14 04:45:06 +01:00
|
|
|
;;
|
|
|
|
esac
|
|
|
|
exit $RETVAL
|