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:
@@ -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=
|
||||
|
||||
Reference in New Issue
Block a user