]>
Commit | Line | Data |
---|---|---|
4819ff03 | 1 | <?xml version='1.0'?> <!--*-nxml-*--> |
4819ff03 | 2 | <!DOCTYPE refentry PUBLIC "-//OASIS//DTD DocBook XML V4.2//EN" |
12b42c76 | 3 | "http://www.oasis-open.org/docbook/xml/4.2/docbookx.dtd"> |
4819ff03 LP |
4 | |
5 | <!-- | |
572eb058 | 6 | SPDX-License-Identifier: LGPL-2.1+ |
4819ff03 LP |
7 | --> |
8 | ||
9 | <refentry id="systemd.kill"> | |
798d3a52 ZJS |
10 | <refentryinfo> |
11 | <title>systemd.kill</title> | |
12 | <productname>systemd</productname> | |
798d3a52 ZJS |
13 | </refentryinfo> |
14 | ||
15 | <refmeta> | |
16 | <refentrytitle>systemd.kill</refentrytitle> | |
17 | <manvolnum>5</manvolnum> | |
18 | </refmeta> | |
19 | ||
20 | <refnamediv> | |
21 | <refname>systemd.kill</refname> | |
22 | <refpurpose>Process killing procedure | |
23 | configuration</refpurpose> | |
24 | </refnamediv> | |
25 | ||
26 | <refsynopsisdiv> | |
27 | <para><filename><replaceable>service</replaceable>.service</filename>, | |
28 | <filename><replaceable>socket</replaceable>.socket</filename>, | |
29 | <filename><replaceable>mount</replaceable>.mount</filename>, | |
30 | <filename><replaceable>swap</replaceable>.swap</filename>, | |
31 | <filename><replaceable>scope</replaceable>.scope</filename></para> | |
32 | </refsynopsisdiv> | |
33 | ||
34 | <refsect1> | |
35 | <title>Description</title> | |
36 | ||
37 | <para>Unit configuration files for services, sockets, mount | |
38 | points, swap devices and scopes share a subset of configuration | |
39 | options which define the killing procedure of processes belonging | |
40 | to the unit.</para> | |
41 | ||
42 | <para>This man page lists the configuration options shared by | |
43 | these five unit types. See | |
44 | <citerefentry><refentrytitle>systemd.unit</refentrytitle><manvolnum>5</manvolnum></citerefentry> | |
45 | for the common options shared by all unit configuration files, and | |
46 | <citerefentry><refentrytitle>systemd.service</refentrytitle><manvolnum>5</manvolnum></citerefentry>, | |
47 | <citerefentry><refentrytitle>systemd.socket</refentrytitle><manvolnum>5</manvolnum></citerefentry>, | |
48 | <citerefentry><refentrytitle>systemd.swap</refentrytitle><manvolnum>5</manvolnum></citerefentry>, | |
49 | <citerefentry><refentrytitle>systemd.mount</refentrytitle><manvolnum>5</manvolnum></citerefentry> | |
50 | and | |
51 | <citerefentry><refentrytitle>systemd.scope</refentrytitle><manvolnum>5</manvolnum></citerefentry> | |
52 | for more information on the configuration file options specific to | |
53 | each unit type.</para> | |
54 | ||
55 | <para>The kill procedure configuration options are configured in | |
56 | the [Service], [Socket], [Mount] or [Swap] section, depending on | |
57 | the unit type.</para> | |
58 | </refsect1> | |
59 | ||
60 | <refsect1> | |
61 | <title>Options</title> | |
62 | ||
63 | <variablelist class='unit-directives'> | |
64 | ||
65 | <varlistentry> | |
66 | <term><varname>KillMode=</varname></term> | |
67 | <listitem><para>Specifies how processes of this unit shall be | |
68 | killed. One of | |
69 | <option>control-group</option>, | |
70 | <option>process</option>, | |
71 | <option>mixed</option>, | |
72 | <option>none</option>.</para> | |
73 | ||
74 | <para>If set to <option>control-group</option>, all remaining | |
75 | processes in the control group of this unit will be killed on | |
76 | unit stop (for services: after the stop command is executed, | |
77 | as configured with <varname>ExecStop=</varname>). If set to | |
78 | <option>process</option>, only the main process itself is | |
79 | killed. If set to <option>mixed</option>, the | |
80 | <constant>SIGTERM</constant> signal (see below) is sent to the | |
81 | main process while the subsequent <constant>SIGKILL</constant> | |
82 | signal (see below) is sent to all remaining processes of the | |
83 | unit's control group. If set to <option>none</option>, no | |
84 | process is killed. In this case, only the stop command will be | |
85 | executed on unit stop, but no process be killed otherwise. | |
86 | Processes remaining alive after stop are left in their control | |
87 | group and the control group continues to exist after stop | |
88 | unless it is empty.</para> | |
89 | ||
90 | <para>Processes will first be terminated via | |
91 | <constant>SIGTERM</constant> (unless the signal to send is | |
92 | changed via <varname>KillSignal=</varname>). Optionally, this | |
93 | is immediately followed by a <constant>SIGHUP</constant> (if | |
94 | enabled with <varname>SendSIGHUP=</varname>). If then, after a | |
95 | delay (configured via the <varname>TimeoutStopSec=</varname> | |
96 | option), processes still remain, the termination request is | |
fbb48d4c JR |
97 | repeated with the <constant>SIGKILL</constant> signal or the |
98 | signal specified via <varname>FinalKillSignal=</varname> (unless | |
798d3a52 ZJS |
99 | this is disabled via the <varname>SendSIGKILL=</varname> |
100 | option). See | |
101 | <citerefentry><refentrytitle>kill</refentrytitle><manvolnum>2</manvolnum></citerefentry> | |
102 | for more information.</para> | |
103 | ||
104 | <para>Defaults to | |
105 | <option>control-group</option>.</para></listitem> | |
106 | </varlistentry> | |
107 | ||
108 | <varlistentry> | |
109 | <term><varname>KillSignal=</varname></term> | |
110 | <listitem><para>Specifies which signal to use when killing a | |
111 | service. This controls the signal that is sent as first step | |
112 | of shutting down a unit (see above), and is usually followed | |
113 | by <constant>SIGKILL</constant> (see above and below). For a | |
114 | list of valid signals, see | |
3ba3a79d | 115 | <citerefentry project='man-pages'><refentrytitle>signal</refentrytitle><manvolnum>7</manvolnum></citerefentry>. |
e8c53936 LP |
116 | Defaults to <constant>SIGTERM</constant>. </para> |
117 | ||
b938cb90 JE |
118 | <para>Note that, right after sending the signal specified in |
119 | this setting, systemd will always send | |
e8c53936 LP |
120 | <constant>SIGCONT</constant>, to ensure that even suspended |
121 | tasks can be terminated cleanly.</para> | |
122 | </listitem> | |
798d3a52 ZJS |
123 | </varlistentry> |
124 | ||
125 | <varlistentry> | |
126 | <term><varname>SendSIGHUP=</varname></term> | |
127 | <listitem><para>Specifies whether to send | |
128 | <constant>SIGHUP</constant> to remaining processes immediately | |
129 | after sending the signal configured with | |
130 | <varname>KillSignal=</varname>. This is useful to indicate to | |
131 | shells and shell-like programs that their connection has been | |
132 | severed. Takes a boolean value. Defaults to "no". | |
133 | </para></listitem> | |
134 | </varlistentry> | |
135 | ||
136 | <varlistentry> | |
137 | <term><varname>SendSIGKILL=</varname></term> | |
138 | <listitem><para>Specifies whether to send | |
fbb48d4c JR |
139 | <constant>SIGKILL</constant> (or the signal specified by |
140 | <varname>FinalKillSignal=</varname>) to remaining processes | |
141 | after a timeout, if the normal shutdown procedure left | |
c53d2d54 DB |
142 | processes of the service around. When disabled, a |
143 | <varname>KillMode=</varname> of <constant>control-group</constant> | |
144 | or <constant>mixed</constant> service will not restart if | |
145 | processes from prior services exist within the control group. | |
146 | Takes a boolean value. Defaults to "yes". | |
fbb48d4c JR |
147 | </para></listitem> |
148 | </varlistentry> | |
149 | ||
150 | <varlistentry> | |
151 | <term><varname>FinalKillSignal=</varname></term> | |
152 | <listitem><para>Specifies which signal to send to remaining | |
153 | processes after a timeout if <varname>SendSIGKILL=</varname> | |
154 | is enabled. The signal configured here should be one that is | |
155 | not typically caught and processed by services (<constant>SIGTERM</constant> | |
156 | is not suitable). Developers can find it useful to use this to | |
157 | generate a coredump to troubleshoot why a service did not | |
158 | terminate upon receiving the initial <constant>SIGTERM</constant> | |
159 | signal. This can be achieved by configuring <varname>LimitCORE=</varname> | |
160 | and setting <varname>FinalKillSignal=</varname> to either | |
161 | <constant>SIGQUIT</constant> or <constant>SIGABRT</constant> | |
162 | Defaults to <constant>SIGKILL</constant>. | |
798d3a52 ZJS |
163 | </para></listitem> |
164 | </varlistentry> | |
165 | ||
c87700a1 AZ |
166 | <varlistentry> |
167 | <term><varname>WatchdogSignal=</varname></term> | |
168 | <listitem><para>Specifies which signal to use to terminate the | |
169 | service when the watchdog timeout expires (enabled through | |
170 | <varname>WatchdogSec=</varname>). Defaults to <constant>SIGABRT</constant>. | |
171 | </para></listitem> | |
172 | </varlistentry> | |
173 | ||
798d3a52 ZJS |
174 | </variablelist> |
175 | </refsect1> | |
176 | ||
177 | <refsect1> | |
178 | <title>See Also</title> | |
179 | <para> | |
180 | <citerefentry><refentrytitle>systemd</refentrytitle><manvolnum>1</manvolnum></citerefentry>, | |
181 | <citerefentry><refentrytitle>systemctl</refentrytitle><manvolnum>1</manvolnum></citerefentry>, | |
68d838f7 | 182 | <citerefentry><refentrytitle>journalctl</refentrytitle><manvolnum>1</manvolnum></citerefentry>, |
798d3a52 ZJS |
183 | <citerefentry><refentrytitle>systemd.unit</refentrytitle><manvolnum>5</manvolnum></citerefentry>, |
184 | <citerefentry><refentrytitle>systemd.service</refentrytitle><manvolnum>5</manvolnum></citerefentry>, | |
185 | <citerefentry><refentrytitle>systemd.socket</refentrytitle><manvolnum>5</manvolnum></citerefentry>, | |
186 | <citerefentry><refentrytitle>systemd.swap</refentrytitle><manvolnum>5</manvolnum></citerefentry>, | |
187 | <citerefentry><refentrytitle>systemd.mount</refentrytitle><manvolnum>5</manvolnum></citerefentry>, | |
188 | <citerefentry><refentrytitle>systemd.exec</refentrytitle><manvolnum>5</manvolnum></citerefentry>, | |
189 | <citerefentry><refentrytitle>systemd.directives</refentrytitle><manvolnum>7</manvolnum></citerefentry>, | |
190 | <citerefentry><refentrytitle>kill</refentrytitle><manvolnum>2</manvolnum></citerefentry>, | |
3ba3a79d | 191 | <citerefentry project='man-pages'><refentrytitle>signal</refentrytitle><manvolnum>7</manvolnum></citerefentry> |
798d3a52 ZJS |
192 | </para> |
193 | </refsect1> | |
4819ff03 LP |
194 | |
195 | </refentry> |