1 <?xml version='
1.0'
?> <!--*-nxml-*-->
2 <?xml-stylesheet type=
"text/xsl" href=
"http://docbook.sourceforge.net/release/xsl/current/xhtml/docbook.xsl"?>
3 <!DOCTYPE refentry PUBLIC
"-//OASIS//DTD DocBook XML V4.2//EN"
4 "http://www.oasis-open.org/docbook/xml/4.2/docbookx.dtd">
7 This file is part of systemd.
9 Copyright 2012 Lennart Poettering
11 systemd is free software; you can redistribute it and/or modify it
12 under the terms of the GNU Lesser General Public License as published by
13 the Free Software Foundation; either version 2.1 of the License, or
14 (at your option) any later version.
16 systemd is distributed in the hope that it will be useful, but
17 WITHOUT ANY WARRANTY; without even the implied warranty of
18 MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
19 Lesser General Public License for more details.
21 You should have received a copy of the GNU Lesser General Public License
22 along with systemd; If not, see <http://www.gnu.org/licenses/>.
25 <refentry id=
"systemd.kill">
27 <title>systemd.kill
</title>
28 <productname>systemd
</productname>
32 <contrib>Developer
</contrib>
33 <firstname>Lennart
</firstname>
34 <surname>Poettering
</surname>
35 <email>lennart@poettering.net
</email>
41 <refentrytitle>systemd.kill
</refentrytitle>
42 <manvolnum>5</manvolnum>
46 <refname>systemd.kill
</refname>
47 <refpurpose>Process killing procedure
48 configuration
</refpurpose>
52 <para><filename><replaceable>service
</replaceable>.service
</filename>,
53 <filename><replaceable>socket
</replaceable>.socket
</filename>,
54 <filename><replaceable>mount
</replaceable>.mount
</filename>,
55 <filename><replaceable>swap
</replaceable>.swap
</filename>,
56 <filename><replaceable>scope
</replaceable>.scope
</filename></para>
60 <title>Description
</title>
62 <para>Unit configuration files for services, sockets,
63 mount points, swap devices and scopes share a subset
64 of configuration options which define the
65 killing procedure of processes belonging to the unit.
</para>
67 <para>This man page lists the configuration options
68 shared by these five unit types. See
69 <citerefentry><refentrytitle>systemd.unit
</refentrytitle><manvolnum>5</manvolnum></citerefentry>
70 for the common options shared by all unit
71 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>
77 <citerefentry><refentrytitle>systemd.scope
</refentrytitle><manvolnum>5</manvolnum></citerefentry>
78 for more information on the configuration file options
79 specific to each unit type.
</para>
81 <para>The kill procedure
82 configuration options are configured in the [Service],
83 [Socket], [Mount] or [Swap] section, depending on the
88 <title>Options
</title>
90 <variablelist class='unit-directives'
>
93 <term><varname>KillMode=
</varname></term>
94 <listitem><para>Specifies how
95 processes of this unit shall be
97 <option>control-group
</option>,
98 <option>process
</option>,
99 <option>mixed
</option>,
100 <option>none
</option>.
</para>
103 <option>control-group
</option>, all
104 remaining processes in the control
105 group of this unit will be killed on
106 unit stop (for services: after the
107 stop command is executed, as
109 <varname>ExecStop=
</varname>). If set
110 to
<option>process
</option>, only the
111 main process itself is killed. If set
112 to
<option>mixed
</option>, the
113 <constant>SIGTERM
</constant> signal
114 (see below) is sent to the main
115 process while the subsequent
116 <constant>SIGKILL
</constant> signal
117 (see below) is sent to all remaining
118 processes of the unit's control
120 <option>none
</option>, no process is
121 killed. In this case, only the stop
122 command will be executed on unit stop,
123 but no process be killed
124 otherwise. Processes remaining alive
125 after stop are left in their control
126 group and the control group continues
127 to exist after stop unless it is
130 <para>Processes will first be
132 <constant>SIGTERM
</constant> (unless
133 the signal to send is changed via
134 <varname>KillSignal=
</varname>). Optionally,
135 this is immediately followed by a
136 <constant>SIGHUP
</constant> (if
138 <varname>SendSIGHUP=
</varname>). If
139 then, after a delay (configured via the
140 <varname>TimeoutStopSec=
</varname> option),
141 processes still remain, the
142 termination request is repeated with
143 the
<constant>SIGKILL
</constant>
144 signal (unless this is disabled via
145 the
<varname>SendSIGKILL=
</varname>
147 <citerefentry><refentrytitle>kill
</refentrytitle><manvolnum>2</manvolnum></citerefentry>
152 <option>control-group
</option>.
</para></listitem>
156 <term><varname>KillSignal=
</varname></term>
157 <listitem><para>Specifies which signal
158 to use when killing a service. This
159 controls the signal that is sent as
160 first step of shutting down a unit
161 (see above), and is usually followed
162 by
<constant>SIGKILL
</constant> (see
163 above and below). For a list of valid
165 <citerefentry><refentrytitle>signal
</refentrytitle><manvolnum>7</manvolnum></citerefentry>. Defaults
166 to
<constant>SIGTERM
</constant>.
171 <term><varname>SendSIGHUP=
</varname></term>
172 <listitem><para>Specifies whether to
173 send
<constant>SIGHUP
</constant> to
174 remaining processes immediately after
175 sending the signal configured with
176 <varname>KillSignal=
</varname>. This
177 is useful to indicate to shells and
178 shell-like programs that their
179 connection has been severed. Takes a
180 boolean value. Defaults to
"no".
185 <term><varname>SendSIGKILL=
</varname></term>
186 <listitem><para>Specifies whether to
187 send
<constant>SIGKILL
</constant> to remaining processes
188 after a timeout, if the normal
189 shutdown procedure left processes of
190 the service around. Takes a boolean
191 value. Defaults to
"yes".
199 <title>See Also
</title>
201 <citerefentry><refentrytitle>systemd
</refentrytitle><manvolnum>1</manvolnum></citerefentry>,
202 <citerefentry><refentrytitle>systemctl
</refentrytitle><manvolnum>1</manvolnum></citerefentry>,
203 <citerefentry><refentrytitle>journalctl
</refentrytitle><manvolnum>8</manvolnum></citerefentry>,
204 <citerefentry><refentrytitle>systemd.unit
</refentrytitle><manvolnum>5</manvolnum></citerefentry>,
205 <citerefentry><refentrytitle>systemd.service
</refentrytitle><manvolnum>5</manvolnum></citerefentry>,
206 <citerefentry><refentrytitle>systemd.socket
</refentrytitle><manvolnum>5</manvolnum></citerefentry>,
207 <citerefentry><refentrytitle>systemd.swap
</refentrytitle><manvolnum>5</manvolnum></citerefentry>,
208 <citerefentry><refentrytitle>systemd.mount
</refentrytitle><manvolnum>5</manvolnum></citerefentry>,
209 <citerefentry><refentrytitle>systemd.exec
</refentrytitle><manvolnum>5</manvolnum></citerefentry>,
210 <citerefentry><refentrytitle>systemd.directives
</refentrytitle><manvolnum>7</manvolnum></citerefentry>,
211 <citerefentry><refentrytitle>kill
</refentrytitle><manvolnum>2</manvolnum></citerefentry>,
212 <citerefentry><refentrytitle>signal
</refentrytitle><manvolnum>7</manvolnum></citerefentry>