]> git.ipfire.org Git - thirdparty/systemd.git/blob - man/systemd-halt.service.xml
tree-wide: remove Lennart's copyright lines
[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 SPDX-License-Identifier: LGPL-2.1+
7 -->
8
9 <refentry id="systemd-halt.service">
10
11 <refentryinfo>
12 <title>systemd-halt.service</title>
13 <productname>systemd</productname>
14
15 <authorgroup>
16 <author>
17 <contrib>Developer</contrib>
18 <firstname>Lennart</firstname>
19 <surname>Poettering</surname>
20 <email>lennart@poettering.net</email>
21 </author>
22 </authorgroup>
23 </refentryinfo>
24
25 <refmeta>
26 <refentrytitle>systemd-halt.service</refentrytitle>
27 <manvolnum>8</manvolnum>
28 </refmeta>
29
30 <refnamediv>
31 <refname>systemd-halt.service</refname>
32 <refname>systemd-poweroff.service</refname>
33 <refname>systemd-reboot.service</refname>
34 <refname>systemd-kexec.service</refname>
35 <refname>systemd-shutdown</refname>
36 <refpurpose>System shutdown logic</refpurpose>
37 </refnamediv>
38
39 <refsynopsisdiv>
40 <para><filename>systemd-halt.service</filename></para>
41 <para><filename>systemd-poweroff.service</filename></para>
42 <para><filename>systemd-reboot.service</filename></para>
43 <para><filename>systemd-kexec.service</filename></para>
44 <para><filename>/usr/lib/systemd/systemd-shutdown</filename></para>
45 <para><filename>/usr/lib/systemd/system-shutdown/</filename></para>
46 </refsynopsisdiv>
47
48 <refsect1>
49 <title>Description</title>
50
51 <para><filename>systemd-halt.service</filename> is a system
52 service that is pulled in by <filename>halt.target</filename> and
53 is responsible for the actual system halt. Similarly,
54 <filename>systemd-poweroff.service</filename> is pulled in by
55 <filename>poweroff.target</filename>,
56 <filename>systemd-reboot.service</filename> by
57 <filename>reboot.target</filename> and
58 <filename>systemd-kexec.service</filename> by
59 <filename>kexec.target</filename> to execute the respective
60 actions.</para>
61
62 <para>When these services are run, they ensure that PID 1 is
63 replaced by the
64 <filename>/usr/lib/systemd/systemd-shutdown</filename> tool which
65 is then responsible for the actual shutdown. Before shutting down,
66 this binary will try to unmount all remaining file systems,
67 disable all remaining swap devices, detach all remaining storage
68 devices and kill all remaining processes.</para>
69
70 <para>It is necessary to have this code in a separate binary
71 because otherwise rebooting after an upgrade might be broken — the
72 running PID 1 could still depend on libraries which are not
73 available any more, thus keeping the file system busy, which then
74 cannot be re-mounted read-only.</para>
75
76 <para>Immediately before executing the actual system
77 halt/poweroff/reboot/kexec <filename>systemd-shutdown</filename>
78 will run all executables in
79 <filename>/usr/lib/systemd/system-shutdown/</filename> and pass
80 one arguments to them: either <literal>halt</literal>,
81 <literal>poweroff</literal>, <literal>reboot</literal> or
82 <literal>kexec</literal>, depending on the chosen action. All
83 executables in this directory are executed in parallel, and
84 execution of the action is not continued before all executables
85 finished.</para>
86
87 <para>Note that <filename>systemd-halt.service</filename> (and the
88 related units) should never be executed directly. Instead, trigger
89 system shutdown with a command such as <literal>systemctl
90 halt</literal> or suchlike.</para>
91 </refsect1>
92
93 <refsect1>
94 <title>See Also</title>
95 <para>
96 <citerefentry><refentrytitle>systemd</refentrytitle><manvolnum>1</manvolnum></citerefentry>,
97 <citerefentry><refentrytitle>systemctl</refentrytitle><manvolnum>1</manvolnum></citerefentry>,
98 <citerefentry><refentrytitle>systemd.special</refentrytitle><manvolnum>7</manvolnum></citerefentry>,
99 <citerefentry><refentrytitle>reboot</refentrytitle><manvolnum>2</manvolnum></citerefentry>,
100 <citerefentry><refentrytitle>systemd-suspend.service</refentrytitle><manvolnum>8</manvolnum></citerefentry>,
101 <citerefentry><refentrytitle>bootup</refentrytitle><manvolnum>7</manvolnum></citerefentry>
102 </para>
103 </refsect1>
104
105 </refentry>