dbus: use start-stop-daemon

This commit is contained in:
Fredrik Rinnestam 2015-06-28 00:12:20 +02:00
parent e0c934f890
commit 213fb97c72
2 changed files with 31 additions and 21 deletions

View File

@ -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

View File

@ -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