configs/bananapro: bump Linux to 4.10.4
[buildroot-gz.git] / package / dbus / S30dbus
blobb4bcf9c7aa9a8f52904e21c71bfb41616f7aa3f6
1 #!/bin/sh
3 # messagebus: The D-BUS systemwide message bus
5 # chkconfig: 345 97 03
6 # description: This is a daemon which broadcasts notifications of system events \
7 # and other messages. See http://www.freedesktop.org/software/dbus/
9 # processname: dbus-daemon
10 # pidfile: /var/run/messagebus.pid
13 # Sanity checks.
14 [ -x /usr/bin/dbus-daemon ] || exit 0
16 # Create needed directories.
17 [ -d /var/run/dbus ] || mkdir -p /var/run/dbus
18 [ -d /var/lock/subsys ] || mkdir -p /var/lock/subsys
19 [ -d /tmp/dbus ] || mkdir -p /tmp/dbus
21 RETVAL=0
23 start() {
24 printf "Starting system message bus: "
26 dbus-uuidgen --ensure
27 dbus-daemon --system
28 RETVAL=$?
29 echo "done"
30 [ $RETVAL -eq 0 ] && touch /var/lock/subsys/dbus-daemon
33 stop() {
34 printf "Stopping system message bus: "
36 ## we don't want to kill all the per-user $processname, we want
37 ## to use the pid file *only*; because we use the fake nonexistent
38 ## program name "$servicename" that should be safe-ish
39 killall dbus-daemon
40 RETVAL=$?
41 echo "done"
42 if [ $RETVAL -eq 0 ]; then
43 rm -f /var/lock/subsys/dbus-daemon
44 rm -f /var/run/messagebus.pid
48 # See how we were called.
49 case "$1" in
50 start)
51 start
53 stop)
54 stop
56 restart)
57 stop
58 start
60 condrestart)
61 if [ -f /var/lock/subsys/$servicename ]; then
62 stop
63 start
66 reload)
67 echo "Message bus can't reload its configuration, you have to restart it"
68 RETVAL=$?
71 echo "Usage: $0 {start|stop|restart|condrestart|reload}"
73 esac
74 exit $RETVAL