Skip to contentSkip to conversation

package/shairport-sync: fix init script (stop)

PATCH New Carlos Santos 2 participants 3 messages Dec 20, 2018 – Jan 1, 2019

lore
Share & tools
lore
#0 lore raw

PATCH v2 1/1 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

---
Changes v1->v2
- Recreated patch with the PID checking part

---
 package/shairport-sync/S99shairport-sync | 6 ++++--
 1 file changed, 4 insertions(+), 2 deletions(-)
package/shairport-sync/S99shairport-sync +4 -2
index 5443ed138c..80b2fddbc6 100644
@@ -6,16 +6,18 @@ OPTIONS="-d"
 case "$1" in
     start)
 	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"
 	;;
     stop)
 	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"
 	;;
     restart)
 	$0 stop
+	sleep 1
 	$0 start
 	;;
     *)
Signature · 1 line
2.19.2
#1 lore raw

PATCH v2 1/1 package/shairport-sync: fix init script (stop)

Quoted 9 lines
Quoted 1 line
Quoted 1 line
Quoted 1 line
Quoted 1 line

"Carlos" == Carlos Santos <[email protected]> writes:

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.

Quoted 5 lines

Fixes:
https://bugs.busybox.net/show_bug.cgi?id=11566

Committed, thanks.

Signature · 1 line
Bye, Peter Korsgaard
#2 lore raw

PATCH v2 1/1 package/shairport-sync: fix init script (stop)

In reply to Carlos Santos
Quoted 9 lines
Quoted 1 line
Quoted 1 line
Quoted 1 line
Quoted 1 line

"Carlos" == Carlos Santos <[email protected]> writes:

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.

Quoted 8 lines

Fixes:
https://bugs.busybox.net/show_bug.cgi?id=11566

---
Changes v1->v2
- Recreated patch with the PID checking part

Committed to 2018.02.x and 2018.11.x, thanks.

Signature · 1 line
Bye, Peter Korsgaard