systemd/man/systemd-shutdown.html
2015-02-17 11:22:16 +01:00

60 lines
4.7 KiB
HTML
Raw Blame History

This file contains invisible Unicode characters

This file contains invisible Unicode characters that are indistinguishable to humans but may be processed differently by a computer. If you think that this is intentional, you can safely ignore this warning. Use the Escape button to reveal them.

<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>
a.headerlink {
color: #c60f0f;
font-size: 0.8em;
padding: 0 4px 0 4px;
text-decoration: none;
visibility: hidden;
}
a.headerlink:hover {
background-color: #c60f0f;
color: white;
}
h1:hover > a.headerlink, h2:hover > a.headerlink, h3:hover > a.headerlink, dt:hover > a.headerlink {
visibility: visible;
}
</style><a href="index.html">Index </a>·
<a href="systemd.directives.html">Directives </a>·
<a href="../python-systemd/index.html">Python </a>·
<a href="../libudev/index.html">libudev </a>·
<a href="../libudev/index.html">gudev </a><span style="float:right">systemd 219</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="idm140022452053280"></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 system
service that is pulled in by <code class="filename">halt.target</code> and
is responsible for the actual system halt. Similarly,
<code class="filename">systemd-poweroff.service</code> is pulled in by
<code class="filename">poweroff.target</code>,
<code class="filename">systemd-reboot.service</code> by
<code class="filename">reboot.target</code> and
<code class="filename">systemd-kexec.service</code> by
<code class="filename">kexec.target</code> to execute the respective
actions.</p><p>When these services are run, they ensure that PID 1 is
replaced by the
<code class="filename">/usr/lib/systemd/systemd-shutdown</code> tool which
is then responsible for the actual shutdown. Before shutting down,
this binary will try to unmount all remaining file systems,
disable all remaining swap devices, detach all remaining storage
devices and kill all remaining processes.</p><p>It is necessary to have this code in a separate binary
because otherwise rebooting after an upgrade might be broken — the
running PID 1 could still depend on libraries which are not
available any more, thus keeping the file system busy, which then
cannot be re-mounted read-only.</p><p>Immediately before executing the actual system
halt/poweroff/reboot/kexec <code class="filename">systemd-shutdown</code>
will run all executables in
<code class="filename">/usr/lib/systemd/system-shutdown/</code> and pass
one arguments to them: either "<code class="literal">halt</code>",
"<code class="literal">poweroff</code>", "<code class="literal">reboot</code>" or
"<code class="literal">kexec</code>", depending on the chosen action. All
executables in this directory are executed in parallel, and
execution of the action is not continued before all executables
finished.</p><p>Note that <code class="filename">systemd-halt.service</code> (and the
related units) should never be executed directly. Instead, trigger
system shutdown with a command such as "<code class="literal">systemctl
halt</code>" or suchlike.</p></div><div class="refsect1"><a name="idm140022455939872"></a><h2 id="See Also">See Also<a class="headerlink" title="Permalink to this headline" href="#See%20Also"></a></h2><p>
<a href="systemd.html"><span class="citerefentry"><span class="refentrytitle">systemd</span>(1)</span></a>,
<a href="systemctl.html"><span class="citerefentry"><span class="refentrytitle">systemctl</span>(1)</span></a>,
<a href="systemd.special.html"><span class="citerefentry"><span class="refentrytitle">systemd.special</span>(7)</span></a>,
<a href="http://man7.org/linux/man-pages/man2/reboot.2.html"><span class="citerefentry"><span class="refentrytitle">reboot</span>(2)</span></a>,
<a href="systemd-suspend.service.html"><span class="citerefentry"><span class="refentrytitle">systemd-suspend.service</span>(8)</span></a>
</p></div></div></body></html>