blob: d4a8037a5605c1cb90d7b788f96a193ed3e06112 (
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 OPTS="--system"
9
10 case $1 in
11 start)
12 if [ ! -f /var/lib/dbus/machine-id ]
13 then
14 /usr/bin/dbus-uuidgen --ensure
15 fi
16 $SSD --start --exec $PROG -- $OPTS
17 ;;
18 stop)
19 $SSD --stop --retry 10 --exec $PROG
20 ;;
21 restart)
22 $0 stop
23 $0 start
24 ;;
25 status)
26 $SSD --status --exec $PROG
27 case $? in
28 0) echo "$PROG is running with pid $(pidof $PROG)" ;;
29 1) echo "$PROG is not running but the pid file $PID exists" ;;
30 3) echo "$PROG is not running" ;;
31 4) echo "Unable to determine the program status" ;;
32 esac
33 ;;
34 *)
35 echo "usage: $0 [start|stop|restart|status]"
36 ;;
37 esac
|