swaync-service-dispatcher: add -b to block on service state query, to avoid incorrect responses when run in parallel

This commit is contained in:
2024-04-27 12:32:12 +00:00
parent c50ef59102
commit 39d31c3ffd

View File

@@ -23,7 +23,7 @@ checkActive() {
s6)
# simulate a dry-run start. if no actions would be performed, then the service is up.
# alternative is s6-svstat, but that doesn't support oneshots
test -z "$(s6-rc -n 0 start "$service")" && echo true || echo false
test -z "$(s6-rc -n 0 -b start "$service")" && echo true || echo false
;;
esac
}
@@ -34,7 +34,7 @@ startService() {
/run/wrappers/bin/sudo systemctl start "$service"
;;
s6)
s6-rc start "$service"
s6-rc -b start "$service"
;;
esac
}
@@ -45,7 +45,7 @@ stopService() {
/run/wrappers/bin/sudo systemctl stop "$service"
;;
s6)
s6-rc stop "$service"
s6-rc -b stop "$service"
;;
esac
}