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