]>
Commit | Line | Data |
---|---|---|
e2b696ee LP |
1 | <?xml version='1.0'?> <!--*-nxml-*--> |
2 | <!DOCTYPE refentry PUBLIC "-//OASIS//DTD DocBook XML V4.2//EN" | |
3 | "http://www.oasis-open.org/docbook/xml/4.2/docbookx.dtd"> | |
4 | ||
5 | <!-- | |
6 | This file is part of systemd. | |
7 | ||
8 | Copyright 2012 Lennart Poettering | |
19adb8a3 | 9 | Copyright 2013 Zbigniew Jędrzejewski-Szmek |
e2b696ee LP |
10 | |
11 | systemd is free software; you can redistribute it and/or modify it | |
12 | under the terms of the GNU Lesser General Public License as published by | |
13 | the Free Software Foundation; either version 2.1 of the License, or | |
14 | (at your option) any later version. | |
15 | ||
16 | systemd is distributed in the hope that it will be useful, but | |
17 | WITHOUT ANY WARRANTY; without even the implied warranty of | |
18 | MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU | |
19 | Lesser General Public License for more details. | |
20 | ||
21 | You should have received a copy of the GNU Lesser General Public License | |
22 | along with systemd; If not, see <http://www.gnu.org/licenses/>. | |
23 | --> | |
24 | ||
dfdebb1b ZJS |
25 | <refentry id="systemd-suspend.service" |
26 | xmlns:xi="http://www.w3.org/2001/XInclude"> | |
e2b696ee LP |
27 | |
28 | <refentryinfo> | |
29 | <title>systemd-suspend.service</title> | |
30 | <productname>systemd</productname> | |
31 | ||
32 | <authorgroup> | |
33 | <author> | |
34 | <contrib>Developer</contrib> | |
35 | <firstname>Lennart</firstname> | |
36 | <surname>Poettering</surname> | |
37 | <email>lennart@poettering.net</email> | |
38 | </author> | |
39 | </authorgroup> | |
40 | </refentryinfo> | |
41 | ||
42 | <refmeta> | |
43 | <refentrytitle>systemd-suspend.service</refentrytitle> | |
44 | <manvolnum>8</manvolnum> | |
45 | </refmeta> | |
46 | ||
47 | <refnamediv> | |
48 | <refname>systemd-suspend.service</refname> | |
49 | <refname>systemd-hibernate.service</refname> | |
6524990f | 50 | <refname>systemd-hybrid-sleep.service</refname> |
e2b696ee | 51 | <refname>systemd-sleep</refname> |
34511ca7 | 52 | <refpurpose>System sleep state logic</refpurpose> |
e2b696ee LP |
53 | </refnamediv> |
54 | ||
55 | <refsynopsisdiv> | |
56 | <para><filename>systemd-suspend.service</filename></para> | |
57 | <para><filename>systemd-hibernate.service</filename></para> | |
6524990f | 58 | <para><filename>systemd-hybrid-sleep.service</filename></para> |
36d054aa | 59 | <para><filename>/usr/lib/systemd/system-sleep</filename></para> |
e2b696ee LP |
60 | </refsynopsisdiv> |
61 | ||
62 | <refsect1> | |
63 | <title>Description</title> | |
64 | ||
65 | <para><filename>systemd-suspend.service</filename> is | |
66 | a system service that is pulled in by | |
67 | <filename>suspend.target</filename> and is responsible | |
19adb8a3 | 68 | for the actual system suspend. Similarly, |
e2b696ee LP |
69 | <filename>systemd-hibernate.service</filename> is |
70 | pulled in by <filename>hibernate.target</filename> to | |
6524990f LP |
71 | execute the actual hibernation. Finally, |
72 | <filename>systemd-hybrid-sleep.service</filename> is | |
73 | pulled in by <filename>hybrid-sleep.target</filename> | |
74 | to execute hybrid hibernation with system | |
75 | suspend.</para> | |
76 | ||
77 | <para>Immediately before entering system suspend | |
78 | and/or hibernation | |
79 | <filename>systemd-suspend.service</filename> (and the | |
80 | other mentioned units, respectively) will run all | |
81 | executables in | |
e2b696ee LP |
82 | <filename>/usr/lib/systemd/system-sleep/</filename> |
83 | and pass two arguments to them. The first argument | |
909f413d ZJS |
84 | will be <literal>pre</literal>, the second either |
85 | <literal>suspend</literal>, | |
86 | <literal>hibernate</literal>, or | |
87 | <literal>hybrid-sleep</literal> depending on the | |
0127336c | 88 | chosen action. Immediately after leaving system |
6524990f | 89 | suspend and/or hibernation the same executables are run, |
0127336c | 90 | but the first argument is now |
909f413d | 91 | <literal>post</literal>. All executables in this |
0127336c | 92 | directory are executed in parallel, and execution of |
19adb8a3 ZJS |
93 | the action is not continued until all executables |
94 | have finished.</para> | |
e2b696ee LP |
95 | |
96 | <para>Note that scripts or binaries dropped in | |
97 | <filename>/usr/lib/systemd/system-sleep/</filename> | |
98 | are intended for local use only and should be | |
99 | considered hacks. If applications want to be notified | |
79640424 | 100 | of system suspend/hibernation and resume, there are |
6524990f | 101 | much nicer interfaces available.</para> |
e2b696ee | 102 | |
0127336c | 103 | <para>Note that |
6524990f | 104 | <filename>systemd-suspend.service</filename>, |
19adb8a3 | 105 | <filename>systemd-hibernate.service</filename>, and |
6524990f LP |
106 | <filename>systemd-hybrid-sleep.service</filename> |
107 | should never be executed directly. Instead, trigger | |
108 | system sleep states with a command such as | |
909f413d | 109 | <literal>systemctl suspend</literal> or |
6524990f | 110 | similar.</para> |
630d4e14 LP |
111 | |
112 | <para>Internally, this service will echo a string like | |
909f413d | 113 | <literal>mem</literal> into |
630d4e14 | 114 | <filename>/sys/power/state</filename>, to trigger the |
19adb8a3 ZJS |
115 | actual system suspend. What exactly is written |
116 | where can be configured in the <literal>[Sleep]</literal> | |
117 | section of <filename>/etc/systemd/sleep.conf</filename>. | |
118 | See <citerefentry><refentrytitle>systemd-sleep.conf</refentrytitle><manvolnum>5</manvolnum></citerefentry>. | |
119 | </para> | |
120 | </refsect1> | |
121 | ||
122 | <refsect1> | |
123 | <title>Options</title> | |
124 | ||
125 | <para><command>systemd-sleep</command> understands the | |
126 | following commands:</para> | |
127 | ||
128 | <variablelist> | |
dfdebb1b ZJS |
129 | <xi:include href="standard-options.xml" xpointer="help" /> |
130 | <xi:include href="standard-options.xml" xpointer="version" /> | |
19adb8a3 | 131 | |
19adb8a3 ZJS |
132 | <varlistentry> |
133 | <term><option>suspend</option></term> | |
134 | <term><option>hibernate</option></term> | |
135 | <term><option>hybrid-sleep</option></term> | |
136 | ||
137 | <listitem><para>Suspend, hibernate, or | |
138 | put the system to hybrid sleep.</para> | |
139 | </listitem> | |
140 | </varlistentry> | |
141 | </variablelist> | |
e2b696ee LP |
142 | </refsect1> |
143 | ||
144 | <refsect1> | |
145 | <title>See Also</title> | |
146 | <para> | |
19adb8a3 | 147 | <citerefentry><refentrytitle>systemd-sleep.conf</refentrytitle><manvolnum>5</manvolnum></citerefentry>, |
e2b696ee | 148 | <citerefentry><refentrytitle>systemd</refentrytitle><manvolnum>1</manvolnum></citerefentry>, |
0127336c LP |
149 | <citerefentry><refentrytitle>systemctl</refentrytitle><manvolnum>1</manvolnum></citerefentry>, |
150 | <citerefentry><refentrytitle>systemd.special</refentrytitle><manvolnum>7</manvolnum></citerefentry>, | |
e2b696ee LP |
151 | <citerefentry><refentrytitle>systemd-halt.service</refentrytitle><manvolnum>8</manvolnum></citerefentry> |
152 | </para> | |
153 | </refsect1> | |
154 | ||
155 | </refentry> |