Skip to content

Commit

Permalink
systemd: make scripts fail if systemctl start does
Browse files Browse the repository at this point in the history
Problem: flux-run-{prolog,epilog,housekeeping} scripts do not
fail if systemctl start fails.

Replace "wait" with "wait $!".
The former always returns success.
  • Loading branch information
garlick committed Oct 3, 2024
1 parent 7b98dd4 commit a6f6491
Show file tree
Hide file tree
Showing 3 changed files with 3 additions and 3 deletions.
2 changes: 1 addition & 1 deletion src/cmd/flux-run-epilog.in
Original file line number Diff line number Diff line change
Expand Up @@ -18,4 +18,4 @@ printenv >@X_RUNSTATEDIR@/${unitname}.env
# Run systemctl start in background and `wait` for it so that the trap
# will run immediately when signal is received:
systemctl start $unitname --quiet &
wait
wait $!
2 changes: 1 addition & 1 deletion src/cmd/flux-run-housekeeping.in
Original file line number Diff line number Diff line change
Expand Up @@ -18,4 +18,4 @@ printenv >@X_RUNSTATEDIR@/${unitname}.env
# Run systemctl start in background and `wait` for it so that the trap
# will run immediately when signal is received:
systemctl start $unitname --quiet &
wait
wait $!
2 changes: 1 addition & 1 deletion src/cmd/flux-run-prolog.in
Original file line number Diff line number Diff line change
Expand Up @@ -18,4 +18,4 @@ printenv >@X_RUNSTATEDIR@/${unitname}.env
# Run systemctl start in background and `wait` for it so that the trap
# will run immediately when signal is received:
systemctl start $unitname --quiet &
wait
wait $!

0 comments on commit a6f6491

Please sign in to comment.