Initial Commit
- initial default booting image
This commit is contained in:
70
package/dbus/S30dbus-daemon
Normal file
70
package/dbus/S30dbus-daemon
Normal file
@@ -0,0 +1,70 @@
|
||||
#!/bin/sh
|
||||
|
||||
DAEMON="dbus-daemon"
|
||||
PIDFILE="/var/run/$DAEMON.pid"
|
||||
|
||||
start() {
|
||||
printf 'Starting system %s: ' "$DAEMON"
|
||||
# Create needed directories
|
||||
mkdir -p /run/dbus
|
||||
mkdir -p /tmp/dbus
|
||||
# Generate /var/lib/dbus/machine-id if needed
|
||||
dbus-uuidgen --ensure
|
||||
|
||||
start-stop-daemon --start --pidfile "$PIDFILE" \
|
||||
--exec "/usr/bin/$DAEMON" \
|
||||
-- --system --syslog
|
||||
status=$?
|
||||
if [ "$status" -eq 0 ]; then
|
||||
echo "OK"
|
||||
else
|
||||
echo "FAIL"
|
||||
fi
|
||||
return "$status"
|
||||
}
|
||||
|
||||
stop() {
|
||||
printf 'Stopping %s: ' "$DAEMON"
|
||||
start-stop-daemon --stop --pidfile "$PIDFILE" --exec "/usr/bin/$DAEMON"
|
||||
status=$?
|
||||
if [ "$status" -eq 0 ]; then
|
||||
echo "OK"
|
||||
else
|
||||
echo "FAIL"
|
||||
return "$status"
|
||||
fi
|
||||
while start-stop-daemon --stop --test --quiet --pidfile "$PIDFILE" \
|
||||
--exec "/usr/bin/$DAEMON"; do
|
||||
sleep 0.1
|
||||
done
|
||||
rm -f "$PIDFILE"
|
||||
return "$status"
|
||||
}
|
||||
|
||||
reload() {
|
||||
printf "Reloading %s config: " "$DAEMON"
|
||||
start-stop-daemon --stop --signal HUP -q --pidfile "$PIDFILE" \
|
||||
--exec "/usr/bin/$DAEMON"
|
||||
status=$?
|
||||
if [ "$status" -eq 0 ]; then
|
||||
echo "OK"
|
||||
else
|
||||
echo "FAIL"
|
||||
fi
|
||||
return "$status"
|
||||
}
|
||||
|
||||
restart() {
|
||||
stop
|
||||
start
|
||||
}
|
||||
|
||||
case "$1" in
|
||||
start|stop|reload|restart)
|
||||
"$1"
|
||||
;;
|
||||
*)
|
||||
echo "Usage: $0 {start|stop|restart|reload}"
|
||||
exit 1
|
||||
;;
|
||||
esac
|
||||
Reference in New Issue
Block a user