core: add support for RestartKillSignal= to override signal used for restart jobs

v2:
- if RestartKillSignal= is not specified, fall back to KillSignal=. This is necessary
  to preserve backwards compatibility (and keep KillSignal= generally useful).
This commit is contained in:
Zbigniew Jędrzejewski-Szmek
2019-10-02 14:01:25 +02:00
parent 28a2dfe801
commit a232ebcc2c
15 changed files with 85 additions and 16 deletions
+8
View File
@@ -19,6 +19,14 @@ systemd-run --unit=four -p Type=exec /bin/sleep infinity
! systemd-run --unit=five -p Type=exec -p User=idontexist /bin/sleep infinity
! systemd-run --unit=six -p Type=exec /tmp/brokenbinary
systemd-run --unit=seven -p KillSignal=SIGTERM -p RestartKillSignal=SIGINT -p Type=exec /bin/sleep infinity
# Both TERM and SIGINT happen to have the same number on all architectures
test $(systemctl show --value -p KillSignal seven.service) -eq 15
test $(systemctl show --value -p RestartKillSignal seven.service) -eq 2
systemctl restart seven.service
systemctl stop seven.service
systemd-analyze log-level info
echo OK > /testok
@@ -185,6 +185,7 @@ RequiresMountsFor=
Requisite=
Restart=
RestartForceExitStatus=
RestartKillSignal=
RestartPreventExitStatus=
RestartSec=
ReusePort=