mirror of
https://git.proxmox.com/git/systemd
synced 2025-05-29 10:01:12 +00:00
69 lines
6.3 KiB
HTML
69 lines
6.3 KiB
HTML
<html><head><meta http-equiv="Content-Type" content="text/html; charset=UTF-8"><title>systemd-suspend.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-suspend.service"></a><div class="titlepage"></div><div class="refnamediv"><h2>Name</h2><p>systemd-suspend.service, systemd-hibernate.service, systemd-hybrid-sleep.service, systemd-sleep — System sleep state logic</p></div><div class="refsynopsisdiv"><h2>Synopsis</h2><p><code class="filename">systemd-suspend.service</code></p><p><code class="filename">systemd-hibernate.service</code></p><p><code class="filename">systemd-hybrid-sleep.service</code></p><p><code class="filename">/usr/lib/systemd/system-sleep</code></p></div><div class="refsect1"><a name="idm140595851644208"></a><h2 id="Description">Description<a class="headerlink" title="Permalink to this headline" href="#Description">¶</a></h2><p><code class="filename">systemd-suspend.service</code> is a system
|
|
service that is pulled in by <code class="filename">suspend.target</code>
|
|
and is responsible for the actual system suspend. Similarly,
|
|
<code class="filename">systemd-hibernate.service</code> is pulled in by
|
|
<code class="filename">hibernate.target</code> to execute the actual
|
|
hibernation. Finally,
|
|
<code class="filename">systemd-hybrid-sleep.service</code> is pulled in by
|
|
<code class="filename">hybrid-sleep.target</code> to execute hybrid
|
|
hibernation with system suspend.</p><p>Immediately before entering system suspend and/or
|
|
hibernation <code class="filename">systemd-suspend.service</code> (and the
|
|
other mentioned units, respectively) will run all executables in
|
|
<code class="filename">/usr/lib/systemd/system-sleep/</code> and pass two
|
|
arguments to them. The first argument will be
|
|
"<code class="literal">pre</code>", the second either
|
|
"<code class="literal">suspend</code>", "<code class="literal">hibernate</code>", or
|
|
"<code class="literal">hybrid-sleep</code>" depending on the chosen action.
|
|
Immediately after leaving system suspend and/or hibernation the
|
|
same executables are run, but the first argument is now
|
|
"<code class="literal">post</code>". All executables in this directory are
|
|
executed in parallel, and execution of the action is not continued
|
|
until all executables have finished.</p><p>Note that scripts or binaries dropped in
|
|
<code class="filename">/usr/lib/systemd/system-sleep/</code> are intended
|
|
for local use only and should be considered hacks. If applications
|
|
want to be notified of system suspend/hibernation and resume,
|
|
there are much nicer interfaces available.</p><p>Note that
|
|
<code class="filename">systemd-suspend.service</code>,
|
|
<code class="filename">systemd-hibernate.service</code>, and
|
|
<code class="filename">systemd-hybrid-sleep.service</code>
|
|
should never be executed directly. Instead, trigger system sleep
|
|
states with a command such as "<code class="literal">systemctl suspend</code>"
|
|
or similar.</p><p>Internally, this service will echo a string like
|
|
"<code class="literal">mem</code>" into <code class="filename">/sys/power/state</code>,
|
|
to trigger the actual system suspend. What exactly is written
|
|
where can be configured in the "<code class="literal">[Sleep]</code>" section
|
|
of <code class="filename">/etc/systemd/sleep.conf</code> or a
|
|
<code class="filename">sleep.conf.d</code> file. See
|
|
<a href="systemd-sleep.conf.html"><span class="citerefentry"><span class="refentrytitle">systemd-sleep.conf</span>(5)</span></a>.
|
|
</p></div><div class="refsect1"><a name="idm140595855526128"></a><h2 id="Options">Options<a class="headerlink" title="Permalink to this headline" href="#Options">¶</a></h2><p><span class="command"><strong>systemd-sleep</strong></span> understands the
|
|
following commands:</p><div class="variablelist"><dl class="variablelist"><dt id="-h"><span class="term"><code class="option">-h</code>, </span><span class="term"><code class="option">--help</code></span><a class="headerlink" title="Permalink to this term" href="#-h">¶</a></dt><dd><p><a name="help-text"></a>Print a short help text and exit.
|
|
</p></dd><dt id="--version"><span class="term"><code class="option">--version</code></span><a class="headerlink" title="Permalink to this term" href="#--version">¶</a></dt><dd><p><a name="version-text"></a>Print a short version string and exit.</p></dd><dt id="suspend"><span class="term"><code class="option">suspend</code>, </span><span class="term"><code class="option">hibernate</code>, </span><span class="term"><code class="option">hybrid-sleep</code></span><a class="headerlink" title="Permalink to this term" href="#suspend">¶</a></dt><dd><p>Suspend, hibernate, or put the system to
|
|
hybrid sleep.</p></dd></dl></div></div><div class="refsect1"><a name="idm140595855519600"></a><h2 id="See Also">See Also<a class="headerlink" title="Permalink to this headline" href="#See%20Also">¶</a></h2><p>
|
|
<a href="systemd-sleep.conf.html"><span class="citerefentry"><span class="refentrytitle">systemd-sleep.conf</span>(5)</span></a>,
|
|
<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="systemd-halt.service.html"><span class="citerefentry"><span class="refentrytitle">systemd-halt.service</span>(8)</span></a>
|
|
</p></div></div></body></html>
|