Debian Codegraph @

upstream/debian-unstable/man5/systemd.kill.5

raw
1 '\" t
2 .TH "SYSTEMD\&.KILL" "5" "" "systemd 261~rc3" "systemd.kill"
3 .\" -----------------------------------------------------------------
4 .\" * Define some portability stuff
5 .\" -----------------------------------------------------------------
6 .\" ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
7 .\" http://bugs.debian.org/507673
8 .\" http://lists.gnu.org/archive/html/groff/2009-02/msg00013.html
9 .\" ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
10 .ie \n(.g .ds Aq \(aq
11 .el .ds Aq '
12 .\" -----------------------------------------------------------------
13 .\" * set default formatting
14 .\" -----------------------------------------------------------------
15 .\" disable hyphenation
16 .nh
17 .\" disable justification (adjust text to left margin only)
18 .ad l
19 .\" -----------------------------------------------------------------
20 .\" * MAIN CONTENT STARTS HERE *
21 .\" -----------------------------------------------------------------
22 .SH "NAME"
23 systemd.kill \- Process killing procedure configuration
24 .SH "SYNOPSIS"
25 .PP
26 \fIservice\fR\&.service,
27 \fIsocket\fR\&.socket,
28 \fImount\fR\&.mount,
29 \fIswap\fR\&.swap,
30 \fIscope\fR\&.scope
31 .SH "DESCRIPTION"
32 .PP
33 Unit configuration files for services, sockets, mount points, swap devices and scopes share a subset of configuration options which define the killing procedure of processes belonging to the unit\&.
34 .PP
35 This man page lists the configuration options shared by these five unit types\&. See
36 \fBsystemd.unit\fR(5)
37 for the common options shared by all unit configuration files, and
38 \fBsystemd.service\fR(5),
39 \fBsystemd.socket\fR(5),
40 \fBsystemd.swap\fR(5),
41 \fBsystemd.mount\fR(5)
42 and
43 \fBsystemd.scope\fR(5)
44 for more information on the configuration file options specific to each unit type\&.
45 .PP
46 The kill procedure configuration options are configured in the [Service], [Socket], [Mount] or [Swap] section, depending on the unit type\&.
47 .SH "OPTIONS"
48 .PP
49 \fIKillMode=\fR
50 .RS 4
51 Specifies how processes of this unit shall be killed\&. One of
52 \fBcontrol\-group\fR,
53 \fBmixed\fR,
54 \fBprocess\fR,
55 \fBnone\fR\&.
56 .sp
57 If set to
58 \fBcontrol\-group\fR, all remaining processes in the control group of this unit will be killed on unit stop (for services: after the stop command is executed, as configured with
59 \fIExecStop=\fR)\&. If set to
60 \fBmixed\fR, the
61 \fBSIGTERM\fR
62 signal (see below) is sent to the main process while the subsequent
63 \fBSIGKILL\fR
64 signal (see below) is sent to all remaining processes of the unit\*(Aqs control group\&. If set to
65 \fBprocess\fR, only the main process itself is killed (not recommended!)\&. If set to
66 \fBnone\fR, no process is killed (strongly recommended against!)\&. In this case, only the stop command will be executed on unit stop, but no process will be killed otherwise\&. Processes remaining alive after stop are left in their control group and the control group continues to exist after stop unless empty\&.
67 .sp
68 Note that it is not recommended to set
69 \fIKillMode=\fR
70 to
71 \fBprocess\fR
72 or even
73 \fBnone\fR, as this allows processes to escape the service manager\*(Aqs lifecycle and resource management, and to remain running even while their service is considered stopped and is assumed to not consume any resources\&.
74 .sp
75 Processes will first be terminated via
76 \fBSIGTERM\fR
77 (unless the signal to send is changed via
78 \fIKillSignal=\fR
79 or
80 \fIRestartKillSignal=\fR)\&. Optionally, this is immediately followed by a
81 \fBSIGHUP\fR
82 (if enabled with
83 \fISendSIGHUP=\fR)\&. If processes still remain after:
84 .sp
85 .RS 4
86 .ie n \{\
87 \h'-04'\(bu\h'+03'\c
88 .\}
89 .el \{\
90 .sp -1
91 .IP \(bu 2.3
92 .\}
93 the main process of a unit has exited (applies to
94 \fIKillMode=\fR:
95 \fBmixed\fR)
96 .RE
97 .sp
98 .RS 4
99 .ie n \{\
100 \h'-04'\(bu\h'+03'\c
101 .\}
102 .el \{\
103 .sp -1
104 .IP \(bu 2.3
105 .\}
106 the delay configured via the
107 \fITimeoutStopSec=\fR
108 has passed (applies to
109 \fIKillMode=\fR:
110 \fBcontrol\-group\fR,
111 \fBmixed\fR,
112 \fBprocess\fR)
113 .RE
114 .sp
115 the termination request is repeated with the
116 \fBSIGKILL\fR
117 signal or the signal specified via
118 \fIFinalKillSignal=\fR
119 (unless this is disabled via the
120 \fISendSIGKILL=\fR
121 option)\&. See
122 \fBkill\fR(2)
123 for more information\&.
124 .sp
125 Defaults to
126 \fBcontrol\-group\fR\&.
127 .sp
128 Added in version 187\&.
129 .RE
130 .PP
131 \fIKillSignal=\fR
132 .RS 4
133 Specifies which signal to use when stopping a service\&. This controls the signal that is sent as first step of shutting down a unit (see above), and is usually followed by
134 \fBSIGKILL\fR
135 (see above and below)\&. For a list of valid signals, see
136 \fBsignal\fR(7)\&. Defaults to
137 \fBSIGTERM\fR\&.
138 .sp
139 Note that, right after sending the signal specified in this setting, systemd will always send
140 \fBSIGCONT\fR, to ensure that even suspended tasks can be terminated cleanly\&.
141 .sp
142 Added in version 187\&.
143 .RE
144 .PP
145 \fIRestartKillSignal=\fR
146 .RS 4
147 Specifies which signal to use when restarting a service\&. The same as
148 \fIKillSignal=\fR
149 described above, with the exception that this setting is used in a restart job\&. Not set by default, and the value of
150 \fIKillSignal=\fR
151 is used\&.
152 .sp
153 Added in version 244\&.
154 .RE
155 .PP
156 \fISendSIGHUP=\fR
157 .RS 4
158 Specifies whether to send
159 \fBSIGHUP\fR
160 to remaining processes immediately after sending the signal configured with
161 \fIKillSignal=\fR\&. This is useful to indicate to shells and shell\-like programs that their connection has been severed\&. Takes a boolean value\&. Defaults to
162 "no"\&.
163 .sp
164 Added in version 207\&.
165 .RE
166 .PP
167 \fISendSIGKILL=\fR
168 .RS 4
169 Specifies whether to send
170 \fBSIGKILL\fR
171 (or the signal specified by
172 \fIFinalKillSignal=\fR) to remaining processes after a timeout, if the normal shutdown procedure left processes of the service around\&. When disabled, a
173 \fIKillMode=\fR
174 of
175 \fBcontrol\-group\fR
176 or
177 \fBmixed\fR
178 service will not restart if processes from prior services exist within the control group\&. Takes a boolean value\&. Defaults to
179 "yes"\&.
180 .sp
181 Added in version 187\&.
182 .RE
183 .PP
184 \fIFinalKillSignal=\fR
185 .RS 4
186 Specifies which signal to send to remaining processes after a timeout if
187 \fISendSIGKILL=\fR
188 is enabled\&. The signal configured here should be one that is not typically caught and processed by services (\fBSIGTERM\fR
189 is not suitable)\&. Developers can find it useful to use this to generate a coredump to troubleshoot why a service did not terminate upon receiving the initial
190 \fBSIGTERM\fR
191 signal\&. This can be achieved by configuring
192 \fILimitCORE=\fR
193 and setting
194 \fIFinalKillSignal=\fR
195 to either
196 \fBSIGQUIT\fR
197 or
198 \fBSIGABRT\fR\&. Defaults to
199 \fBSIGKILL\fR\&.
200 .sp
201 Added in version 240\&.
202 .RE
203 .PP
204 \fIWatchdogSignal=\fR
205 .RS 4
206 Specifies which signal to use to terminate the service when the watchdog timeout expires (enabled through
207 \fIWatchdogSec=\fR)\&. Defaults to
208 \fBSIGABRT\fR\&.
209 .sp
210 Added in version 240\&.
211 .RE
212 .SH "SEE ALSO"
213 .PP
214 \fBsystemd\fR(1), \fBsystemctl\fR(1), \fBjournalctl\fR(1), \fBsystemd.unit\fR(5), \fBsystemd.service\fR(5), \fBsystemd.socket\fR(5), \fBsystemd.swap\fR(5), \fBsystemd.mount\fR(5), \fBsystemd.exec\fR(5), \fBsystemd.directives\fR(7), \fBkill\fR(2), \fBsignal\fR(7)