From 2055dc5ae57298aa6aa4e81b985affa5577c7e01 Mon Sep 17 00:00:00 2001 From: Jens Maus Date: Sat, 23 Sep 2023 12:00:35 +0200 Subject: [PATCH] package/linux-tools: fix SysV init script This commit fixes the S10hyperv SysV init script which expects binaries to be locate in /sbin while they are installed in /usr/sbin. Please note, that the systemd init scripts correctly reference them. Furthermore, the SysV init script did not check for an actual HyperV environment to be present, which is also corrected. In addition, this commit also fixes check-package warnings regarding a missing DAEMON definition. Signed-off-by: Jens Maus [Peter: drop from .checkpackageignore] Signed-off-by: Peter Korsgaard (cherry picked from commit 14c4bd7bf8150283e158c50df87c77d63bb1b73c) Signed-off-by: Peter Korsgaard --- .checkpackageignore | 1 - package/linux-tools/S10hyperv | 8 ++++++-- 2 files changed, 6 insertions(+), 3 deletions(-) diff --git a/.checkpackageignore b/.checkpackageignore index 4faa3a8b8f..dbff352d3b 100644 --- a/.checkpackageignore +++ b/.checkpackageignore @@ -93,7 +93,6 @@ package/libftdi/0002-libftdi.pc-requires-libusb-fix-static-build.patch Sob package/libiio/S99iiod Shellcheck Variables package/libmad/0001-mips-h-constraint-removal.patch Sob package/lighttpd/S50lighttpd EmptyLastLine Indent Shellcheck Variables -package/linux-tools/S10hyperv Variables package/linuxptp/S65ptp4l Indent Shellcheck package/linuxptp/S66phc2sys Indent Shellcheck package/lirc-tools/S25lircd Indent Variables diff --git a/package/linux-tools/S10hyperv b/package/linux-tools/S10hyperv index 32887d1b6c..be9ed2c5df 100644 --- a/package/linux-tools/S10hyperv +++ b/package/linux-tools/S10hyperv @@ -2,14 +2,18 @@ PROGS="@PROGS@" PIDDIR="/var/run" +DAEMON="hyperv" # shellcheck source=/dev/null -[ -r "/etc/default/hyperv" ] && . "/etc/default/hyperv" +[ -r "/etc/default/$DAEMON" ] && . "/etc/default/$DAEMON" + +# only continue if we are in a HyperV platform +[ -e "/sys/bus/vmbus" ] || exit 0 start_one() { printf 'Starting %s: ' "$1" # shellcheck disable=SC2086 # we need the word splitting - start-stop-daemon -b -m -S -q -p "$PIDDIR/$1.pid" -x "/sbin/$1" -- -n + start-stop-daemon -b -m -S -q -p "$PIDDIR/$1.pid" -x "/usr/sbin/$1" -- -n status=$? if [ "$status" -eq 0 ]; then echo "OK"