The cirros image was rebuilt against the 3.13.0-83 kernel, drivers e1000e, igbvf...
[packages/trusty/cirros-testvm.git] / cirros-testvm / src-cirros / buildroot-2015.05 / package / dbus / S30dbus
1 #!/bin/sh
2 #
3 # messagebus:   The D-BUS systemwide message bus
4 #
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/
8 #
9 # processname: dbus-daemon
10 # pidfile: /var/run/messagebus.pid
11 #
12
13 # Sanity checks.
14 [ -x /usr/bin/dbus-daemon ] || exit 0
15
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
20
21 RETVAL=0
22
23 start() {
24     echo -n "Starting system message bus: "
25
26     dbus-uuidgen --ensure
27     dbus-daemon --system
28     RETVAL=$?
29     echo "done"
30     [ $RETVAL -eq 0 ] && touch /var/lock/subsys/dbus-daemon
31 }
32
33 stop() {
34     echo -n "Stopping system message bus: "
35
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
45     fi
46 }
47
48 # See how we were called.
49 case "$1" in
50     start)
51         start
52         ;;
53     stop)
54         stop
55         ;;
56     status)
57         status $processname
58         RETVAL=$?
59         ;;
60     restart)
61         stop
62         start
63         ;;
64     condrestart)
65         if [ -f /var/lock/subsys/$servicename ]; then
66             stop
67             start
68         fi
69         ;;
70     reload)
71         echo "Message bus can't reload its configuration, you have to restart it"
72         RETVAL=$?
73         ;;
74     *)
75         echo "Usage: $0 {start|stop|status|restart|condrestart|reload}"
76         ;;
77 esac
78 exit $RETVAL