summaryrefslogtreecommitdiff
path: root/dbus
diff options
context:
space:
mode:
Diffstat (limited to 'dbus')
-rw-r--r--dbus/Pkgfile4
-rw-r--r--dbus/rc.dbus48
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

Generated by cgit