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