mirror of
https://gitlab.com/buildroot.org/buildroot.git
synced 2026-09-30 22:11:59 -09:00
package/shairport-sync: fix init script (stop)
shairport-sync creates its pidfile at /var/run/shairport-sync/, so pass
that path to start-stop-daemon in the stop operation.
Also pass the executable path, allowing start-stop-daemon to check if
the PID matches the shairport-sync process, preventing killing some
other inocent daemon.
Fixes:
https://bugs.busybox.net/show_bug.cgi?id=11566
Reported-by: Bin Zhang <yangtze31@gmail.com>
Signed-off-by: Carlos Santos <casantos@datacom.com.br>
Signed-off-by: Peter Korsgaard <peter@korsgaard.com>
(cherry picked from commit 6568b93929)
Signed-off-by: Peter Korsgaard <peter@korsgaard.com>
This commit is contained in:
committed by
Peter Korsgaard
parent
29675f8e54
commit
74cf3121d4
@@ -6,16 +6,18 @@ OPTIONS="-d"
|
|||||||
case "$1" in
|
case "$1" in
|
||||||
start)
|
start)
|
||||||
printf "Starting shairport-sync: "
|
printf "Starting shairport-sync: "
|
||||||
start-stop-daemon -S -q -p /var/run/shairport-sync.pid --exec /usr/bin/shairport-sync -- $OPTIONS
|
start-stop-daemon -S -q --exec /usr/bin/shairport-sync -- $OPTIONS
|
||||||
[ $? = 0 ] && echo "OK" || echo "FAIL"
|
[ $? = 0 ] && echo "OK" || echo "FAIL"
|
||||||
;;
|
;;
|
||||||
stop)
|
stop)
|
||||||
printf "Stopping shairport-sync: "
|
printf "Stopping shairport-sync: "
|
||||||
start-stop-daemon -K -q -p /var/run/shairport-sync.pid
|
start-stop-daemon -K -q --exec /usr/bin/shairport-sync \
|
||||||
|
-p /var/run/shairport-sync/shairport-sync.pid
|
||||||
[ $? = 0 ] && echo "OK" || echo "FAIL"
|
[ $? = 0 ] && echo "OK" || echo "FAIL"
|
||||||
;;
|
;;
|
||||||
restart)
|
restart)
|
||||||
$0 stop
|
$0 stop
|
||||||
|
sleep 1
|
||||||
$0 start
|
$0 start
|
||||||
;;
|
;;
|
||||||
*)
|
*)
|
||||||
|
|||||||
Reference in New Issue
Block a user