Skip to content

Commit

Permalink
kill systemd worker with --kill-whom=main
Browse files Browse the repository at this point in the history
The "kill" command doesn't take "KillMode" into account and defaults to
"all".
  • Loading branch information
lilydjwg committed Jun 1, 2024
1 parent 78ad6ee commit 65f8ed4
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion lilac2/systemd.py
Original file line number Diff line number Diff line change
Expand Up @@ -142,7 +142,7 @@ def poll_rusage(name: str, deadline: float) -> tuple[RUsage, bool]:
finally:
if timedout:
logger.debug('killing worker service')
subprocess.run(['systemctl', '--user', 'kill', '--signal=SIGINT', name])
subprocess.run(['systemctl', '--user', 'kill', '--kill-whom=main', '--signal=SIGINT', name])
logger.debug('stopping worker service')
# stop whatever may be running (even from a previous batch)
subprocess.run(['systemctl', '--user', 'stop', '--quiet', name])
Expand Down

0 comments on commit 65f8ed4

Please sign in to comment.