1SYSTEMD.KILL(5) systemd.kill SYSTEMD.KILL(5)
2
3
4
6 systemd.kill - Process killing procedure configuration
7
9 service.service, socket.socket, mount.mount, swap.swap, scope.scope
10
12 Unit configuration files for services, sockets, mount points, swap
13 devices and scopes share a subset of configuration options which define
14 the killing procedure of processes belonging to the unit.
15
16 This man page lists the configuration options shared by these five unit
17 types. See systemd.unit(5) for the common options shared by all unit
18 configuration files, and systemd.service(5), systemd.socket(5),
19 systemd.swap(5), systemd.mount(5) and systemd.scope(5) for more
20 information on the configuration file options specific to each unit
21 type.
22
23 The kill procedure configuration options are configured in the
24 [Service], [Socket], [Mount] or [Swap] section, depending on the unit
25 type.
26
28 KillMode=
29 Specifies how processes of this unit shall be killed. One of
30 control-group, mixed, process, none.
31
32 If set to control-group, all remaining processes in the control
33 group of this unit will be killed on unit stop (for services: after
34 the stop command is executed, as configured with ExecStop=). If set
35 to mixed, the SIGTERM signal (see below) is sent to the main
36 process while the subsequent SIGKILL signal (see below) is sent to
37 all remaining processes of the unit's control group. If set to
38 process, only the main process itself is killed (not recommended!).
39 If set to none, no process is killed (strongly recommended
40 against!). In this case, only the stop command will be executed on
41 unit stop, but no process will be killed otherwise. Processes
42 remaining alive after stop are left in their control group and the
43 control group continues to exist after stop unless empty.
44
45 Note that it is not recommended to set KillMode= to process or even
46 none, as this allows processes to escape the service manager's
47 lifecycle and resource management, and to remain running even while
48 their service is considered stopped and is assumed to not consume
49 any resources.
50
51 Processes will first be terminated via SIGTERM (unless the signal
52 to send is changed via KillSignal= or RestartKillSignal=).
53 Optionally, this is immediately followed by a SIGHUP (if enabled
54 with SendSIGHUP=). If processes still remain after:
55
56 • the main process of a unit has exited (applies to KillMode=:
57 mixed)
58
59 • the delay configured via the TimeoutStopSec= has passed
60 (applies to KillMode=: control-group, mixed, process)
61
62 the termination request is repeated with the SIGKILL signal or the
63 signal specified via FinalKillSignal= (unless this is disabled via
64 the SendSIGKILL= option). See kill(2) for more information.
65
66 Defaults to control-group.
67
68 KillSignal=
69 Specifies which signal to use when stopping a service. This
70 controls the signal that is sent as first step of shutting down a
71 unit (see above), and is usually followed by SIGKILL (see above and
72 below). For a list of valid signals, see signal(7). Defaults to
73 SIGTERM.
74
75 Note that, right after sending the signal specified in this
76 setting, systemd will always send SIGCONT, to ensure that even
77 suspended tasks can be terminated cleanly.
78
79 RestartKillSignal=
80 Specifies which signal to use when restarting a service. The same
81 as KillSignal= described above, with the exception that this
82 setting is used in a restart job. Not set by default, and the value
83 of KillSignal= is used.
84
85 SendSIGHUP=
86 Specifies whether to send SIGHUP to remaining processes immediately
87 after sending the signal configured with KillSignal=. This is
88 useful to indicate to shells and shell-like programs that their
89 connection has been severed. Takes a boolean value. Defaults to
90 "no".
91
92 SendSIGKILL=
93 Specifies whether to send SIGKILL (or the signal specified by
94 FinalKillSignal=) to remaining processes after a timeout, if the
95 normal shutdown procedure left processes of the service around.
96 When disabled, a KillMode= of control-group or mixed service will
97 not restart if processes from prior services exist within the
98 control group. Takes a boolean value. Defaults to "yes".
99
100 FinalKillSignal=
101 Specifies which signal to send to remaining processes after a
102 timeout if SendSIGKILL= is enabled. The signal configured here
103 should be one that is not typically caught and processed by
104 services (SIGTERM is not suitable). Developers can find it useful
105 to use this to generate a coredump to troubleshoot why a service
106 did not terminate upon receiving the initial SIGTERM signal. This
107 can be achieved by configuring LimitCORE= and setting
108 FinalKillSignal= to either SIGQUIT or SIGABRT. Defaults to SIGKILL.
109
110 WatchdogSignal=
111 Specifies which signal to use to terminate the service when the
112 watchdog timeout expires (enabled through WatchdogSec=). Defaults
113 to SIGABRT.
114
116 systemd(1), systemctl(1), journalctl(1), systemd.unit(5),
117 systemd.service(5), systemd.socket(5), systemd.swap(5),
118 systemd.mount(5), systemd.exec(5), systemd.directives(7), kill(2),
119 signal(7)
120
121
122
123systemd 254 SYSTEMD.KILL(5)