]> git.ipfire.org Git - thirdparty/systemd.git/blob - man/systemd-halt.service.xml
Merge pull request #2471 from michaelolbrich/transient-mounts
[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 <para><filename>/usr/lib/systemd/system-shutdown/</filename></para>
61 </refsynopsisdiv>
62
63 <refsect1>
64 <title>Description</title>
65
66 <para><filename>systemd-halt.service</filename> is a system
67 service that is pulled in by <filename>halt.target</filename> and
68 is responsible for the actual system halt. Similarly,
69 <filename>systemd-poweroff.service</filename> is pulled in by
70 <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 respective
75 actions.</para>
76
77 <para>When these services are run, they ensure that PID 1 is
78 replaced by the
79 <filename>/usr/lib/systemd/systemd-shutdown</filename> tool which
80 is then responsible for the actual shutdown. Before shutting down,
81 this binary will try to unmount all remaining file systems,
82 disable all remaining swap devices, detach all remaining storage
83 devices and kill all remaining processes.</para>
84
85 <para>It is necessary to have this code in a separate binary
86 because otherwise rebooting after an upgrade might be broken — the
87 running PID 1 could still depend on libraries which are not
88 available any more, thus keeping the file system busy, which then
89 cannot be re-mounted read-only.</para>
90
91 <para>Immediately before executing the actual system
92 halt/poweroff/reboot/kexec <filename>systemd-shutdown</filename>
93 will run all executables in
94 <filename>/usr/lib/systemd/system-shutdown/</filename> and pass
95 one arguments to them: either <literal>halt</literal>,
96 <literal>poweroff</literal>, <literal>reboot</literal> or
97 <literal>kexec</literal>, depending on the chosen action. All
98 executables in this directory are executed in parallel, and
99 execution of the action is not continued before all executables
100 finished.</para>
101
102 <para>Note that <filename>systemd-halt.service</filename> (and the
103 related units) should never be executed directly. Instead, trigger
104 system shutdown with a command such as <literal>systemctl
105 halt</literal> or suchlike.</para>
106 </refsect1>
107
108 <refsect1>
109 <title>See Also</title>
110 <para>
111 <citerefentry><refentrytitle>systemd</refentrytitle><manvolnum>1</manvolnum></citerefentry>,
112 <citerefentry><refentrytitle>systemctl</refentrytitle><manvolnum>1</manvolnum></citerefentry>,
113 <citerefentry><refentrytitle>systemd.special</refentrytitle><manvolnum>7</manvolnum></citerefentry>,
114 <citerefentry><refentrytitle>reboot</refentrytitle><manvolnum>2</manvolnum></citerefentry>,
115 <citerefentry><refentrytitle>systemd-suspend.service</refentrytitle><manvolnum>8</manvolnum></citerefentry>
116 </para>
117 </refsect1>
118
119 </refentry>