dbus: use start-stop-daemon
This commit is contained in:
parent
e0c934f890
commit
213fb97c72
@ -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
|
||||
|
48
dbus/rc.dbus
48
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
|
||||
|
Loading…
x
Reference in New Issue
Block a user