From 65f8ed4180186150277be7d759da84a0a9829c5e Mon Sep 17 00:00:00 2001 From: lilydjwg Date: Sat, 1 Jun 2024 18:01:47 +0800 Subject: [PATCH] kill systemd worker with --kill-whom=main The "kill" command doesn't take "KillMode" into account and defaults to "all". --- lilac2/systemd.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/lilac2/systemd.py b/lilac2/systemd.py index 846ecdd..0188dee 100644 --- a/lilac2/systemd.py +++ b/lilac2/systemd.py @@ -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])