diff --git a/.checkpackageignore b/.checkpackageignore index 0501de75ab..c24cb3db64 100644 --- a/.checkpackageignore +++ b/.checkpackageignore @@ -324,7 +324,6 @@ package/davfs2/0001-src-Makefile.am-do-not-hardcode-fstack-protector-str.patch l package/dbus-cpp/0001-gcc4.7.patch lib_patch.Upstream package/dbus-cpp/0002-cross-compile-tools.patch lib_patch.Upstream package/dbus-cpp/0003-src-pipe.c-fix-build-error-with-gcc-7.x.patch lib_patch.Upstream -package/dbus/S30dbus Shellcheck lib_sysv.Indent lib_sysv.Variables package/dc3dd/0001-no_man.patch lib_patch.Upstream package/dc3dd/0002-fix-autoreconf.patch lib_patch.Upstream package/dc3dd/0003-fix-for-glibc-2.28.patch lib_patch.Upstream diff --git a/package/dbus/S30dbus b/package/dbus/S30dbus deleted file mode 100644 index da02609f2d..0000000000 --- a/package/dbus/S30dbus +++ /dev/null @@ -1,58 +0,0 @@ -#!/bin/sh -# -# messagebus: The D-BUS systemwide message bus -# -# chkconfig: 345 97 03 -# description: This is a daemon which broadcasts notifications of system events \ -# and other messages. See http://www.freedesktop.org/software/dbus/ -# -# processname: dbus-daemon -# pidfile: /run/messagebus.pid -# - -# Create needed directories. -[ -d /run/dbus ] || mkdir -p /run/dbus -[ -d /tmp/dbus ] || mkdir -p /tmp/dbus - -RETVAL=0 - -start() { - printf "Starting system message bus: " - - dbus-uuidgen --ensure - dbus-daemon --system - RETVAL=$? - echo "done" -} - -stop() { - printf "Stopping system message bus: " - killall dbus-daemon - RETVAL=$? - echo "done" - if [ $RETVAL -eq 0 ]; then - rm -f /run/messagebus.pid - fi -} - -# See how we were called. -case "$1" in - start) - start - ;; - stop) - stop - ;; - restart) - stop - start - ;; - reload) - echo "Message bus can't reload its configuration, you have to restart it" - RETVAL=$? - ;; - *) - echo "Usage: $0 {start|stop|restart|reload}" - ;; -esac -exit $RETVAL diff --git a/package/dbus/S30dbus-daemon b/package/dbus/S30dbus-daemon new file mode 100644 index 0000000000..3331b11ced --- /dev/null +++ b/package/dbus/S30dbus-daemon @@ -0,0 +1,71 @@ +#!/bin/sh + +DAEMON="dbus-daemon" +# check-package lib_sysv.Variables +PIDFILE="/run/messagebus.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 diff --git a/package/dbus/dbus.mk b/package/dbus/dbus.mk index 2002e707f0..061a341363 100644 --- a/package/dbus/dbus.mk +++ b/package/dbus/dbus.mk @@ -93,8 +93,8 @@ endef DBUS_POST_INSTALL_TARGET_HOOKS += DBUS_REMOVE_DEVFILES define DBUS_INSTALL_INIT_SYSV - $(INSTALL) -m 0755 -D package/dbus/S30dbus \ - $(TARGET_DIR)/etc/init.d/S30dbus + $(INSTALL) -m 0755 -D package/dbus/S30dbus-daemon \ + $(TARGET_DIR)/etc/init.d/S30dbus-daemon mkdir -p $(TARGET_DIR)/var/lib rm -rf $(TARGET_DIR)/var/lib/dbus