run: honor --no-block for trigger units
Reproducer:
unit=run-nb-trigger-$(date +%s)
systemd-run --no-block --collect --unit="$unit" \
--socket-property=ListenStream=/proc/systemd-run-repro/socket \
/usr/bin/true
echo $?
Before, systemd-run still waited for the trigger unit job and
propagated the socket start failure. With --no-block it should only
verify and enqueue the request, as the service path already does.
Follow-up for 3d161f991e
This commit is contained in:
@@ -205,6 +205,13 @@ grep -q "^SocketMode=0644$" "/run/systemd/transient/$UNIT.socket"
|
||||
grep -qE "^ExecStart=.*true.*$" "/run/systemd/transient/$UNIT.service"
|
||||
systemctl stop "$UNIT.socket" "$UNIT.service" || :
|
||||
|
||||
UNIT="socket-no-block-$RANDOM"
|
||||
systemd-run --no-block --collect \
|
||||
--unit="$UNIT" \
|
||||
--socket-property=ListenStream=/proc/systemd-run-repro/socket \
|
||||
true
|
||||
systemctl stop "$UNIT.socket" "$UNIT.service" || :
|
||||
|
||||
: "Job mode"
|
||||
systemd-run --job-mode=help
|
||||
(! systemd-run --job-mode=foo --scope true)
|
||||
|
||||
Reference in New Issue
Block a user