diff options
author | Fredrik Rinnestam <fredrik@crux.nu> | 2015-06-28 00:12:20 +0200 |
---|---|---|
committer | Fredrik Rinnestam <fredrik@crux.nu> | 2015-06-28 00:12:20 +0200 |
commit | 213fb97c720c751f9f915b9587c461764eb34d63 (patch) | |
tree | 733fe0389405b9d33bad5b680273fac19c4fb937 /dbus | |
parent | e0c934f890547b442063300f148e56d1cc6bbbd5 (diff) | |
download | opt-213fb97c720c751f9f915b9587c461764eb34d63.tar.gz opt-213fb97c720c751f9f915b9587c461764eb34d63.tar.xz |
dbus: use start-stop-daemon
Diffstat (limited to 'dbus')
-rw-r--r-- | dbus/Pkgfile | 4 | ||||
-rw-r--r-- | dbus/rc.dbus | 48 |
2 files changed, 31 insertions, 21 deletions
diff --git a/dbus/Pkgfile b/dbus/Pkgfile index 39aeb66ce..72bf552ef 100644 --- a/dbus/Pkgfile +++ b/dbus/Pkgfile @@ -6,9 +6,9 @@ name=dbus version=1.8.18 -release=1 +release=2 source=(http://dbus.freedesktop.org/releases/dbus/$name-$version.tar.gz \ -rc.dbus 30-dbus.launch) + rc.dbus 30-dbus.launch) build() { cd $name-$version diff --git a/dbus/rc.dbus b/dbus/rc.dbus index b33324778..d4a8037a5 100644 --- a/dbus/rc.dbus +++ b/dbus/rc.dbus @@ -3,26 +3,36 @@ # /etc/rc.d/dbus: start/stop dbus messagebus daemon # +SSD=/sbin/start-stop-daemon +PROG=/usr/sbin/dbus-daemon +OPTS="--system" + case $1 in - start) + start) if [ ! -f /var/lib/dbus/machine-id ] - then - /usr/bin/dbus-uuidgen --ensure - fi - /usr/sbin/dbus-daemon --system - ;; - stop) - killall -q /usr/sbin/dbus-daemon - rm -f /var/run/dbus/dbus.pid - ;; - restart) - $0 stop - sleep 2 - $0 start - ;; - *) - echo "Usage: $0 [start|stop|restart]" - ;; + then + /usr/bin/dbus-uuidgen --ensure + fi + $SSD --start --exec $PROG -- $OPTS + ;; +stop) + $SSD --stop --retry 10 --exec $PROG + ;; +restart) + $0 stop + $0 start + ;; +status) + $SSD --status --exec $PROG + case $? in + 0) echo "$PROG is running with pid $(pidof $PROG)" ;; + 1) echo "$PROG is not running but the pid file $PID exists" ;; + 3) echo "$PROG is not running" ;; + 4) echo "Unable to determine the program status" ;; + esac + ;; +*) + echo "usage: $0 [start|stop|restart|status]" + ;; esac -# End of file |