]> git.proxmox.com Git - systemd.git/blame - man/systemd-shutdown.html
Imported Upstream version 214
[systemd.git] / man / systemd-shutdown.html
CommitLineData
663996b3
MS
1<html><head><meta http-equiv="Content-Type" content="text/html; charset=UTF-8"><title>systemd-halt.service</title><meta name="generator" content="DocBook XSL Stylesheets V1.78.1"></head><body bgcolor="white" text="black" link="#0000FF" vlink="#840084" alink="#0000FF"><style>
2 a.headerlink {
3 color: #c60f0f;
4 font-size: 0.8em;
5 padding: 0 4px 0 4px;
6 text-decoration: none;
7 visibility: hidden;
8 }
9
10 a.headerlink:hover {
11 background-color: #c60f0f;
12 color: white;
13 }
14
15 h1:hover > a.headerlink, h2:hover > a.headerlink, h3:hover > a.headerlink, dt:hover > a.headerlink {
16 visibility: visible;
17 }
18 </style><a href="index.html">Index </a>·
19 <a href="systemd.directives.html">Directives </a>·
20 <a href="../python-systemd/index.html">Python </a>·
21 <a href="../libudev/index.html">libudev </a>·
60f067b4 22 <a href="../libudev/index.html">gudev </a><span style="float:right">systemd 214</span><hr><div class="refentry"><a name="systemd-halt.service"></a><div class="titlepage"></div><div class="refnamediv"><h2>Name</h2><p>systemd-halt.service, systemd-poweroff.service, systemd-reboot.service, systemd-kexec.service, systemd-shutdown — System shutdown logic</p></div><div class="refsynopsisdiv"><h2>Synopsis</h2><p><code class="filename">systemd-halt.service</code></p><p><code class="filename">systemd-poweroff.service</code></p><p><code class="filename">systemd-reboot.service</code></p><p><code class="filename">systemd-kexec.service</code></p><p><code class="filename">/usr/lib/systemd/systemd-shutdown</code></p></div><div class="refsect1"><a name="idm214170881184"></a><h2 id="Description">Description<a class="headerlink" title="Permalink to this headline" href="#Description">¶</a></h2><p><code class="filename">systemd-halt.service</code> is a
663996b3
MS
23 system service that is pulled in by
24 <code class="filename">halt.target</code> and is responsible
60f067b4 25 for the actual system halt. Similarly,
663996b3
MS
26 <code class="filename">systemd-poweroff.service</code> is
27 pulled in by <code class="filename">poweroff.target</code>,
28 <code class="filename">systemd-reboot.service</code> by
29 <code class="filename">reboot.target</code> and
30 <code class="filename">systemd-kexec.service</code> by
31 <code class="filename">kexec.target</code> to execute the
60f067b4 32 respective actions.</p><p>When these services are run, they ensure that PID
663996b3
MS
33 1 is replaced by the
34 <code class="filename">/usr/lib/systemd/systemd-shutdown</code>
35 tool which is then responsible for the actual
60f067b4 36 shutdown. Before shutting down, this binary will try to
663996b3
MS
37 unmount all remaining file systems, disable all
38 remaining swap devices, detach all remaining storage
60f067b4
JS
39 devices and kill all remaining processes.</p><p>It is necessary to have this code in a separate binary
40 because otherwise rebooting after an upgrade might be broken —
41 the running PID 1 could still depend on libraries which are not
42 available any more, thus keeping the file system busy, which
43 then cannot be re-mounted read-only.</p><p>Immediately before executing the actual system
663996b3
MS
44 halt/poweroff/reboot/kexec
45 <code class="filename">systemd-shutdown</code> will run all
46 executables in
47 <code class="filename">/usr/lib/systemd/system-shutdown/</code>
48 and pass one arguments to them: either
49 "<code class="literal">halt</code>",
50 "<code class="literal">poweroff</code>",
51 "<code class="literal">reboot</code>" or
52 "<code class="literal">kexec</code>", depending on the chosen
53 action. All executables in this directory are executed
54 in parallel, and execution of the action is not
55 continued before all executables finished.</p><p>Note that
56 <code class="filename">systemd-halt.service</code> (and the
57 related units) should never be executed
58 directly. Instead, trigger system shutdown with a
59 command such as "<code class="literal">systemctl halt</code>" or
60f067b4 60 suchlike.</p></div><div class="refsect1"><a name="idm214167153872"></a><h2 id="See Also">See Also<a class="headerlink" title="Permalink to this headline" href="#See%20Also">¶</a></h2><p>
663996b3
MS
61 <a href="systemd.html"><span class="citerefentry"><span class="refentrytitle">systemd</span>(1)</span></a>,
62 <a href="systemctl.html"><span class="citerefentry"><span class="refentrytitle">systemctl</span>(1)</span></a>,
63 <a href="systemd.special.html"><span class="citerefentry"><span class="refentrytitle">systemd.special</span>(7)</span></a>,
64 <a href="reboot.html"><span class="citerefentry"><span class="refentrytitle">reboot</span>(2)</span></a>,
65 <a href="systemd-suspend.service.html"><span class="citerefentry"><span class="refentrytitle">systemd-suspend.service</span>(8)</span></a>
66 </p></div></div></body></html>