]> git.proxmox.com Git - systemd.git/blob - man/systemd-suspend.service.html
Imported Upstream version 208
[systemd.git] / man / systemd-suspend.service.html
1 <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>
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>·
22 <a href="../libudev/index.html">gudev </a><span style="float:right">systemd 208</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/systemd-sleep</code></p></div><div class="refsect1"><a name="idm274689275296"></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
23 a system service that is pulled in by
24 <code class="filename">suspend.target</code> and is responsible
25 for the actual system suspend. Similarly,
26 <code class="filename">systemd-hibernate.service</code> is
27 pulled in by <code class="filename">hibernate.target</code> to
28 execute the actual hibernation. Finally,
29 <code class="filename">systemd-hybrid-sleep.service</code> is
30 pulled in by <code class="filename">hybrid-sleep.target</code>
31 to execute hybrid hibernation with system
32 suspend.</p><p>Immediately before entering system suspend
33 and/or hibernation
34 <code class="filename">systemd-suspend.service</code> (and the
35 other mentioned units, respectively) will run all
36 executables in
37 <code class="filename">/usr/lib/systemd/system-sleep/</code>
38 and pass two arguments to them. The first argument
39 will be "<code class="literal">pre</code>", the second either
40 "<code class="literal">suspend</code>",
41 "<code class="literal">hibernate</code>", or
42 "<code class="literal">hybrid-sleep</code>" depending on the
43 chosen action. Immediately after leaving system
44 suspend and/or hibernation the same executables are run,
45 but the first argument is now
46 "<code class="literal">post</code>". All executables in this
47 directory are executed in parallel, and execution of
48 the action is not continued until all executables
49 have finished.</p><p>Note that scripts or binaries dropped in
50 <code class="filename">/usr/lib/systemd/system-sleep/</code>
51 are intended for local use only and should be
52 considered hacks. If applications want to be notified
53 of system suspend/hibernation and resume, there are
54 much nicer interfaces available.</p><p>Note that
55 <code class="filename">systemd-suspend.service</code>,
56 <code class="filename">systemd-hibernate.service</code>, and
57 <code class="filename">systemd-hybrid-sleep.service</code>
58 should never be executed directly. Instead, trigger
59 system sleep states with a command such as
60 "<code class="literal">systemctl suspend</code>" or
61 similar.</p><p>Internally, this service will echo a string like
62 "<code class="literal">mem</code>" into
63 <code class="filename">/sys/power/state</code>, to trigger the
64 actual system suspend. What exactly is written
65 where can be configured in the "<code class="literal">[Sleep]</code>"
66 section of <code class="filename">/etc/systemd/sleep.conf</code>.
67 See <a href="systemd-sleep.conf.html"><span class="citerefentry"><span class="refentrytitle">systemd-sleep.conf</span>(5)</span></a>.
68 </p></div><div class="refsect1"><a name="idm274693205200"></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
69 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>Print a short help
70 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>Print the systemd version
71 identifier 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
72 put the system to hybrid sleep.</p></dd></dl></div></div><div class="refsect1"><a name="idm274693189440"></a><h2 id="See Also">See Also<a class="headerlink" title="Permalink to this headline" href="#See%20Also"></a></h2><p>
73 <a href="systemd-sleep.conf.html"><span class="citerefentry"><span class="refentrytitle">systemd-sleep.conf</span>(5)</span></a>,
74 <a href="systemd.html"><span class="citerefentry"><span class="refentrytitle">systemd</span>(1)</span></a>,
75 <a href="systemctl.html"><span class="citerefentry"><span class="refentrytitle">systemctl</span>(1)</span></a>,
76 <a href="systemd.special.html"><span class="citerefentry"><span class="refentrytitle">systemd.special</span>(7)</span></a>,
77 <a href="systemd-halt.service.html"><span class="citerefentry"><span class="refentrytitle">systemd-halt.service</span>(8)</span></a>
78 </p></div></div></body></html>