package/petitboot: fix pb-discover pidfile creation

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@linux.ibm.com>
Signed-off-by: Arnout Vandecappelle <arnout@mind.be>
(cherry picked from commit 0f04c7ae01)
Signed-off-by: Peter Korsgaard <peter@korsgaard.com>
This commit is contained in:
Reza Arbab 2023-10-09 10:17:23 -05:00 committed by Peter Korsgaard
parent 8b09097f4f
commit cfa253f8dc

View File

@ -15,7 +15,7 @@ start() {
mkdir -p /var/log/petitboot
# 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
@ -31,6 +31,7 @@ stop() {
start-stop-daemon -K -q -p "$PIDFILE"
status=$?
if [ "$status" -eq 0 ]; then
rm -f "$PIDFILE"
echo "OK"
else
echo "FAIL"