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