chiark / gitweb /
remove references of readahead
[elogind.git] / man / systemd-suspend.service.xml
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
9   Copyright 2013 Zbigniew JÄ™drzejewski-Szmek
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
25 <refentry id="systemd-suspend.service"
26           xmlns:xi="http://www.w3.org/2001/XInclude">
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>
50                 <refname>systemd-hybrid-sleep.service</refname>
51                 <refname>systemd-sleep</refname>
52                 <refpurpose>System sleep state logic</refpurpose>
53         </refnamediv>
54
55         <refsynopsisdiv>
56                 <para><filename>systemd-suspend.service</filename></para>
57                 <para><filename>systemd-hibernate.service</filename></para>
58                 <para><filename>systemd-hybrid-sleep.service</filename></para>
59                 <para><filename>/usr/lib/systemd/system-sleep</filename></para>
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
68                 for the actual system suspend. Similarly,
69                 <filename>systemd-hibernate.service</filename> is
70                 pulled in by <filename>hibernate.target</filename> to
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
82                 <filename>/usr/lib/systemd/system-sleep/</filename>
83                 and pass two arguments to them. The first argument
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
88                 chosen action. Immediately after leaving system
89                 suspend and/or hibernation the same executables are run,
90                 but the first argument is now
91                 <literal>post</literal>. All executables in this
92                 directory are executed in parallel, and execution of
93                 the action is not continued until all executables
94                 have finished.</para>
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
100                 of system suspend/hibernation and resume, there are
101                 much nicer interfaces available.</para>
102
103                 <para>Note that
104                 <filename>systemd-suspend.service</filename>,
105                 <filename>systemd-hibernate.service</filename>, and
106                 <filename>systemd-hybrid-sleep.service</filename>
107                 should never be executed directly. Instead, trigger
108                 system sleep states with a command such as
109                 <literal>systemctl suspend</literal> or
110                 similar.</para>
111
112                 <para>Internally, this service will echo a string like
113                 <literal>mem</literal> into
114                 <filename>/sys/power/state</filename>, to trigger the
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>
129                         <xi:include href="standard-options.xml" xpointer="help" />
130                         <xi:include href="standard-options.xml" xpointer="version" />
131
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>
142         </refsect1>
143
144         <refsect1>
145                 <title>See Also</title>
146                 <para>
147                         <citerefentry><refentrytitle>systemd-sleep.conf</refentrytitle><manvolnum>5</manvolnum></citerefentry>,
148                         <citerefentry><refentrytitle>systemd</refentrytitle><manvolnum>1</manvolnum></citerefentry>,
149                         <citerefentry><refentrytitle>systemctl</refentrytitle><manvolnum>1</manvolnum></citerefentry>,
150                         <citerefentry><refentrytitle>systemd.special</refentrytitle><manvolnum>7</manvolnum></citerefentry>,
151                         <citerefentry><refentrytitle>systemd-halt.service</refentrytitle><manvolnum>8</manvolnum></citerefentry>
152                 </para>
153         </refsect1>
154
155 </refentry>