diff --git a/package/iwd/S40iwd b/package/iwd/S40iwd index 978912c67f..c329f3bcc7 100644 --- a/package/iwd/S40iwd +++ b/package/iwd/S40iwd @@ -26,13 +26,20 @@ start() { stop() { printf 'Stopping %s: ' "$DAEMON" - start-stop-daemon --stop --quiet --pidfile "$PIDFILE" + start-stop-daemon --stop --pidfile "$PIDFILE" \ + --exec "/usr/libexec/$DAEMON" status=$? if [ "$status" -eq 0 ]; then echo "OK" else echo "FAIL" + return "$status" fi + while start-stop-daemon --stop --test --quiet --pidfile "$PIDFILE" \ + --exec "/usr/libexec/$DAEMON"; do + sleep 0.1 + done + rm -f "$PIDFILE" return "$status" }