]> git.ipfire.org Git - thirdparty/systemd.git/blob - man/systemd-halt.service.xml
TODO: Remove Elapsed Time DHCPv6 option as it is done
[thirdparty/systemd.git] / man / systemd-halt.service.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 This file is part of systemd.
7
8 Copyright 2012 Lennart Poettering
9
10 systemd is free software; you can redistribute it and/or modify it
11 under the terms of the GNU Lesser General Public License as published by
12 the Free Software Foundation; either version 2.1 of the License, or
13 (at your option) any later version.
14
15 systemd is distributed in the hope that it will be useful, but
16 WITHOUT ANY WARRANTY; without even the implied warranty of
17 MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
18 Lesser General Public License for more details.
19
20 You should have received a copy of the GNU Lesser General Public License
21 along with systemd; If not, see <http://www.gnu.org/licenses/>.
22 -->
23
24 <refentry id="systemd-halt.service">
25
26 <refentryinfo>
27 <title>systemd-halt.service</title>
28 <productname>systemd</productname>
29
30 <authorgroup>
31 <author>
32 <contrib>Developer</contrib>
33 <firstname>Lennart</firstname>
34 <surname>Poettering</surname>
35 <email>lennart@poettering.net</email>
36 </author>
37 </authorgroup>
38 </refentryinfo>
39
40 <refmeta>
41 <refentrytitle>systemd-halt.service</refentrytitle>
42 <manvolnum>8</manvolnum>
43 </refmeta>
44
45 <refnamediv>
46 <refname>systemd-halt.service</refname>
47 <refname>systemd-poweroff.service</refname>
48 <refname>systemd-reboot.service</refname>
49 <refname>systemd-kexec.service</refname>
50 <refname>systemd-shutdown</refname>
51 <refpurpose>System shutdown logic</refpurpose>
52 </refnamediv>
53
54 <refsynopsisdiv>
55 <para><filename>systemd-halt.service</filename></para>
56 <para><filename>systemd-poweroff.service</filename></para>
57 <para><filename>systemd-reboot.service</filename></para>
58 <para><filename>systemd-kexec.service</filename></para>
59 <para><filename>/usr/lib/systemd/systemd-shutdown</filename></para>
60 </refsynopsisdiv>
61
62 <refsect1>
63 <title>Description</title>
64
65 <para><filename>systemd-halt.service</filename> is a
66 system service that is pulled in by
67 <filename>halt.target</filename> and is responsible
68 for the actual system halt. Similarly,
69 <filename>systemd-poweroff.service</filename> is
70 pulled in by <filename>poweroff.target</filename>,
71 <filename>systemd-reboot.service</filename> by
72 <filename>reboot.target</filename> and
73 <filename>systemd-kexec.service</filename> by
74 <filename>kexec.target</filename> to execute the
75 respective actions.</para>
76
77 <para>When these services are run, they ensure that PID
78 1 is replaced by the
79 <filename>/usr/lib/systemd/systemd-shutdown</filename>
80 tool which is then responsible for the actual
81 shutdown. Before shutting down, this binary will try to
82 unmount all remaining file systems, disable all
83 remaining swap devices, detach all remaining storage
84 devices and kill all remaining processes.</para>
85
86 <para>It is necessary to have this code in a separate binary
87 because otherwise rebooting after an upgrade might be broken —
88 the running PID 1 could still depend on libraries which are not
89 available any more, thus keeping the file system busy, which
90 then cannot be re-mounted read-only.</para>
91
92 <para>Immediately before executing the actual system
93 halt/poweroff/reboot/kexec
94 <filename>systemd-shutdown</filename> will run all
95 executables in
96 <filename>/usr/lib/systemd/system-shutdown/</filename>
97 and pass one arguments to them: either
98 <literal>halt</literal>,
99 <literal>poweroff</literal>,
100 <literal>reboot</literal> or
101 <literal>kexec</literal>, depending on the chosen
102 action. All executables in this directory are executed
103 in parallel, and execution of the action is not
104 continued before all executables finished.</para>
105
106 <para>Note that
107 <filename>systemd-halt.service</filename> (and the
108 related units) should never be executed
109 directly. Instead, trigger system shutdown with a
110 command such as <literal>systemctl halt</literal> or
111 suchlike.</para>
112 </refsect1>
113
114 <refsect1>
115 <title>See Also</title>
116 <para>
117 <citerefentry><refentrytitle>systemd</refentrytitle><manvolnum>1</manvolnum></citerefentry>,
118 <citerefentry><refentrytitle>systemctl</refentrytitle><manvolnum>1</manvolnum></citerefentry>,
119 <citerefentry><refentrytitle>systemd.special</refentrytitle><manvolnum>7</manvolnum></citerefentry>,
120 <citerefentry><refentrytitle>reboot</refentrytitle><manvolnum>2</manvolnum></citerefentry>,
121 <citerefentry><refentrytitle>systemd-suspend.service</refentrytitle><manvolnum>8</manvolnum></citerefentry>
122 </para>
123 </refsect1>
124
125 </refentry>