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