]> git.ipfire.org Git - thirdparty/systemd.git/blame - man/systemd-halt.service.xml
final v236 update (#7649)
[thirdparty/systemd.git] / man / systemd-halt.service.xml
CommitLineData
0127336c
LP
1<?xml version='1.0'?> <!--*-nxml-*-->
2<!DOCTYPE refentry PUBLIC "-//OASIS//DTD DocBook XML V4.2//EN"
12b42c76 3 "http://www.oasis-open.org/docbook/xml/4.2/docbookx.dtd">
0127336c
LP
4
5<!--
572eb058
ZJS
6 SPDX-License-Identifier: LGPL-2.1+
7
0127336c
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-halt.service">
27
798d3a52
ZJS
28 <refentryinfo>
29 <title>systemd-halt.service</title>
30 <productname>systemd</productname>
31
32 <authorgroup>
33 <author>
34 <contrib>Developer</contrib>
35 <firstname>Lennart</firstname>
36 <surname>Poettering</surname>
37 <email>lennart@poettering.net</email>
38 </author>
39 </authorgroup>
40 </refentryinfo>
41
42 <refmeta>
43 <refentrytitle>systemd-halt.service</refentrytitle>
44 <manvolnum>8</manvolnum>
45 </refmeta>
46
47 <refnamediv>
48 <refname>systemd-halt.service</refname>
49 <refname>systemd-poweroff.service</refname>
50 <refname>systemd-reboot.service</refname>
51 <refname>systemd-kexec.service</refname>
52 <refname>systemd-shutdown</refname>
53 <refpurpose>System shutdown logic</refpurpose>
54 </refnamediv>
55
56 <refsynopsisdiv>
57 <para><filename>systemd-halt.service</filename></para>
58 <para><filename>systemd-poweroff.service</filename></para>
59 <para><filename>systemd-reboot.service</filename></para>
60 <para><filename>systemd-kexec.service</filename></para>
12b42c76 61 <para><filename>/usr/lib/systemd/systemd-shutdown</filename></para>
7fbbf283 62 <para><filename>/usr/lib/systemd/system-shutdown/</filename></para>
798d3a52
ZJS
63 </refsynopsisdiv>
64
65 <refsect1>
66 <title>Description</title>
67
68 <para><filename>systemd-halt.service</filename> is a system
69 service that is pulled in by <filename>halt.target</filename> and
70 is responsible for the actual system halt. Similarly,
71 <filename>systemd-poweroff.service</filename> is pulled in by
72 <filename>poweroff.target</filename>,
73 <filename>systemd-reboot.service</filename> by
74 <filename>reboot.target</filename> and
75 <filename>systemd-kexec.service</filename> by
76 <filename>kexec.target</filename> to execute the respective
77 actions.</para>
78
79 <para>When these services are run, they ensure that PID 1 is
80 replaced by the
12b42c76 81 <filename>/usr/lib/systemd/systemd-shutdown</filename> tool which
798d3a52
ZJS
82 is then responsible for the actual shutdown. Before shutting down,
83 this binary will try to unmount all remaining file systems,
84 disable all remaining swap devices, detach all remaining storage
85 devices and kill all remaining processes.</para>
86
87 <para>It is necessary to have this code in a separate binary
88 because otherwise rebooting after an upgrade might be broken — the
89 running PID 1 could still depend on libraries which are not
90 available any more, thus keeping the file system busy, which then
91 cannot be re-mounted read-only.</para>
92
93 <para>Immediately before executing the actual system
94 halt/poweroff/reboot/kexec <filename>systemd-shutdown</filename>
95 will run all executables in
12b42c76 96 <filename>/usr/lib/systemd/system-shutdown/</filename> and pass
798d3a52
ZJS
97 one arguments to them: either <literal>halt</literal>,
98 <literal>poweroff</literal>, <literal>reboot</literal> or
99 <literal>kexec</literal>, depending on the chosen action. All
100 executables in this directory are executed in parallel, and
101 execution of the action is not continued before all executables
102 finished.</para>
103
104 <para>Note that <filename>systemd-halt.service</filename> (and the
105 related units) should never be executed directly. Instead, trigger
106 system shutdown with a command such as <literal>systemctl
107 halt</literal> or suchlike.</para>
108 </refsect1>
109
110 <refsect1>
111 <title>See Also</title>
112 <para>
113 <citerefentry><refentrytitle>systemd</refentrytitle><manvolnum>1</manvolnum></citerefentry>,
114 <citerefentry><refentrytitle>systemctl</refentrytitle><manvolnum>1</manvolnum></citerefentry>,
115 <citerefentry><refentrytitle>systemd.special</refentrytitle><manvolnum>7</manvolnum></citerefentry>,
116 <citerefentry><refentrytitle>reboot</refentrytitle><manvolnum>2</manvolnum></citerefentry>,
117 <citerefentry><refentrytitle>systemd-suspend.service</refentrytitle><manvolnum>8</manvolnum></citerefentry>
118 </para>
119 </refsect1>
0127336c
LP
120
121</refentry>