blob: e2d671ddfd4274e5e2e23721bb011c1b47abcd1e (
plain)
1 #!/bin/sh
2 #
3 # /etc/rc.d/dbus: start/stop dbus messagebus daemon
4 #
5
6 SSD=/sbin/start-stop-daemon
7 PROG=/usr/sbin/dbus-daemon
8 PID=/var/run/dbus/dbus.pid
9 OPTS="--system"
10
11 case $1 in
12 start)
13 if [ ! -f /var/lib/dbus/machine-id ]
14 then
15 /usr/bin/dbus-uuidgen --ensure
16 fi
17 $SSD --start --pidfile=$PID --exec $PROG -- $OPTS
18 ;;
19 stop)
20 $SSD --stop --remove-pidfile --retry 10 --pidfile=$PID
21 ;;
22 restart)
23 $0 stop
24 $0 start
25 ;;
26 status)
27 $SSD --status --exec $PROG
28 case $? in
29 0) echo "$PROG is running with pid $(cat $PID)" ;;
30 1) echo "$PROG is not running but the pid file $PID exists" ;;
31 3) echo "$PROG is not running" ;;
32 4) echo "Unable to determine the program status" ;;
33 esac
34 ;;
35 *)
36 echo "usage: $0 [start|stop|restart|status]"
37 ;;
38 esac
|