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