Files
winf-photobooth/package/dbus/S30dbus-daemon
Michael b8783708ae Initial Commit
- initial default booting image
2026-11-06 20:45:42 +01:00

71 lines
1.2 KiB
Bash

#!/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