chiark / gitweb /
build-sys: make PolicyKit support compile-time optional (was runtime-optional already)
[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
10   systemd is free software; you can redistribute it and/or modify it
11   under the terms of the GNU Lesser General Public License as published by
12   the Free Software Foundation; either version 2.1 of the License, or
13   (at your option) any later version.
14
15   systemd is distributed in the hope that it will be useful, but
16   WITHOUT ANY WARRANTY; without even the implied warranty of
17   MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
18   Lesser General Public License for more details.
19
20   You should have received a copy of the GNU Lesser General Public License
21   along with systemd; If not, see <http://www.gnu.org/licenses/>.
22 -->
23
24 <refentry id="systemd-suspend.service">
25
26         <refentryinfo>
27                 <title>systemd-suspend.service</title>
28                 <productname>systemd</productname>
29
30                 <authorgroup>
31                         <author>
32                                 <contrib>Developer</contrib>
33                                 <firstname>Lennart</firstname>
34                                 <surname>Poettering</surname>
35                                 <email>lennart@poettering.net</email>
36                         </author>
37                 </authorgroup>
38         </refentryinfo>
39
40         <refmeta>
41                 <refentrytitle>systemd-suspend.service</refentrytitle>
42                 <manvolnum>8</manvolnum>
43         </refmeta>
44
45         <refnamediv>
46                 <refname>systemd-suspend.service</refname>
47                 <refname>systemd-hibernate.service</refname>
48                 <refname>systemd-hybrid-sleep.service</refname>
49                 <refname>systemd-sleep</refname>
50                 <refpurpose>System sleep state logic</refpurpose>
51         </refnamediv>
52
53         <refsynopsisdiv>
54                 <para><filename>systemd-suspend.service</filename></para>
55                 <para><filename>systemd-hibernate.service</filename></para>
56                 <para><filename>systemd-hybrid-sleep.service</filename></para>
57                 <para><filename>/usr/lib/systemd/systemd-sleep</filename></para>
58         </refsynopsisdiv>
59
60         <refsect1>
61                 <title>Description</title>
62
63                 <para><filename>systemd-suspend.service</filename> is
64                 a system service that is pulled in by
65                 <filename>suspend.target</filename> and is responsible
66                 for the actual system suspend. Similar,
67                 <filename>systemd-hibernate.service</filename> is
68                 pulled in by <filename>hibernate.target</filename> to
69                 execute the actual hibernation. Finally,
70                 <filename>systemd-hybrid-sleep.service</filename> is
71                 pulled in by <filename>hybrid-sleep.target</filename>
72                 to execute hybrid hibernation with system
73                 suspend.</para>
74
75                 <para>Immediately before entering system suspend
76                 and/or hibernation
77                 <filename>systemd-suspend.service</filename> (and the
78                 other mentioned units, respectively) will run all
79                 executables in
80                 <filename>/usr/lib/systemd/system-sleep/</filename>
81                 and pass two arguments to them. The first argument
82                 will be "<literal>pre</literal>", the second either
83                 "<literal>suspend</literal>",
84                 "<literal>hibernate</literal>", or
85                 "<literal>hybrid-sleep</literal>" depending on the
86                 chosen action. Immediately after leaving system
87                 suspend and/or hibernation the same executables are run,
88                 but the first argument is now
89                 "<literal>post</literal>". All executables in this
90                 directory are executed in parallel, and execution of
91                 the action is not continued before all executables
92                 finished.</para>
93
94                 <para>Note that scripts or binaries dropped in
95                 <filename>/usr/lib/systemd/system-sleep/</filename>
96                 are intended for local use only and should be
97                 considered hacks. If applications want to be notified
98                 of system suspend/hibernation and resume there are
99                 much nicer interfaces available.</para>
100
101                 <para>Note that
102                 <filename>systemd-suspend.service</filename>,
103                 <filename>systemd-hibernate.service</filename> and
104                 <filename>systemd-hybrid-sleep.service</filename>
105                 should never be executed directly. Instead, trigger
106                 system sleep states with a command such as
107                 "<literal>systemctl suspend</literal>" or
108                 similar.</para>
109
110                 <para>Internally, this service will echo a string like
111                 <literal>mem</literal> into
112                 <filename>/sys/power/state</filename>, to trigger the
113                 actual system suspend.</para>
114         </refsect1>
115
116         <refsect1>
117                 <title>See Also</title>
118                 <para>
119                         <citerefentry><refentrytitle>systemd</refentrytitle><manvolnum>1</manvolnum></citerefentry>,
120                         <citerefentry><refentrytitle>systemctl</refentrytitle><manvolnum>1</manvolnum></citerefentry>,
121                         <citerefentry><refentrytitle>systemd.special</refentrytitle><manvolnum>7</manvolnum></citerefentry>,
122                         <citerefentry><refentrytitle>systemd-halt.service</refentrytitle><manvolnum>8</manvolnum></citerefentry>
123                 </para>
124         </refsect1>
125
126 </refentry>