commit 213fb97c720c751f9f915b9587c461764eb34d63 Author: Fredrik Rinnestam <fredrik@crux.nu> Date: Sun Jun 28 00:12:20 2015 +0200 dbus: use start-stop-daemon diff --git a/dbus/Pkgfile b/dbus/Pkgfile index 39aeb66..72bf552 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 b333247..d4a8037 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