[Buildroot] [git commit] package/petitboot: fix pb-discover pidfile creation

Arnout Vandecappelle arnout at mind.be
Sun Nov 5 17:14:26 UTC 2023


commit: https://git.buildroot.net/buildroot/commit/?id=0f04c7ae01e2bbbb88b8e39f786bc91f4a01c07c
branch: https://git.buildroot.net/buildroot/commit/?id=refs/heads/master

pb-discover does not create its own pid file. Handle the creation and
removal of the pid file in the init script.

Signed-off-by: Reza Arbab <arbab at linux.ibm.com>
Signed-off-by: Arnout Vandecappelle <arnout at mind.be>
---
 package/petitboot/S15pb-discover | 3 ++-
 1 file changed, 2 insertions(+), 1 deletion(-)

diff --git a/package/petitboot/S15pb-discover b/package/petitboot/S15pb-discover
index 7ecc12e991..9b641298ca 100644
--- a/package/petitboot/S15pb-discover
+++ b/package/petitboot/S15pb-discover
@@ -16,7 +16,7 @@ fi
 start() {
 	printf 'Starting %s: ' "$DAEMON"
 	# shellcheck disable=SC2086 # we need the word splitting
-	start-stop-daemon -S -q -b -p "$PIDFILE" -x "/usr/sbin/$DAEMON" \
+	start-stop-daemon -S -q -b -m -p "$PIDFILE" -x "/usr/sbin/$DAEMON" \
 		-- $PB_DISCOVER_ARGS
 	status=$?
 	if [ "$status" -eq 0 ]; then
@@ -32,6 +32,7 @@ stop() {
 	start-stop-daemon -K -q -p "$PIDFILE"
 	status=$?
 	if [ "$status" -eq 0 ]; then
+		rm -f "$PIDFILE"
 		echo "OK"
 	else
 		echo "FAIL"



More information about the buildroot mailing list