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