]> git.ipfire.org Git - thirdparty/systemd.git/blame - man/systemd-suspend.service.xml
Add pam configuration to allow user sessions to work out of the box
[thirdparty/systemd.git] / man / systemd-suspend.service.xml
CommitLineData
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
25<refentry id="systemd-suspend.service">
26
27 <refentryinfo>
28 <title>systemd-suspend.service</title>
29 <productname>systemd</productname>
30
31 <authorgroup>
32 <author>
33 <contrib>Developer</contrib>
34 <firstname>Lennart</firstname>
35 <surname>Poettering</surname>
36 <email>lennart@poettering.net</email>
37 </author>
38 </authorgroup>
39 </refentryinfo>
40
41 <refmeta>
42 <refentrytitle>systemd-suspend.service</refentrytitle>
43 <manvolnum>8</manvolnum>
44 </refmeta>
45
46 <refnamediv>
47 <refname>systemd-suspend.service</refname>
48 <refname>systemd-hibernate.service</refname>
6524990f 49 <refname>systemd-hybrid-sleep.service</refname>
e2b696ee 50 <refname>systemd-sleep</refname>
34511ca7 51 <refpurpose>System sleep state logic</refpurpose>
e2b696ee
LP
52 </refnamediv>
53
54 <refsynopsisdiv>
55 <para><filename>systemd-suspend.service</filename></para>
56 <para><filename>systemd-hibernate.service</filename></para>
6524990f 57 <para><filename>systemd-hybrid-sleep.service</filename></para>
e2b696ee
LP
58 <para><filename>/usr/lib/systemd/systemd-sleep</filename></para>
59 </refsynopsisdiv>
60
61 <refsect1>
62 <title>Description</title>
63
64 <para><filename>systemd-suspend.service</filename> is
65 a system service that is pulled in by
66 <filename>suspend.target</filename> and is responsible
19adb8a3 67 for the actual system suspend. Similarly,
e2b696ee
LP
68 <filename>systemd-hibernate.service</filename> is
69 pulled in by <filename>hibernate.target</filename> to
6524990f
LP
70 execute the actual hibernation. Finally,
71 <filename>systemd-hybrid-sleep.service</filename> is
72 pulled in by <filename>hybrid-sleep.target</filename>
73 to execute hybrid hibernation with system
74 suspend.</para>
75
76 <para>Immediately before entering system suspend
77 and/or hibernation
78 <filename>systemd-suspend.service</filename> (and the
79 other mentioned units, respectively) will run all
80 executables in
e2b696ee
LP
81 <filename>/usr/lib/systemd/system-sleep/</filename>
82 and pass two arguments to them. The first argument
909f413d
ZJS
83 will be <literal>pre</literal>, the second either
84 <literal>suspend</literal>,
85 <literal>hibernate</literal>, or
86 <literal>hybrid-sleep</literal> depending on the
0127336c 87 chosen action. Immediately after leaving system
6524990f 88 suspend and/or hibernation the same executables are run,
0127336c 89 but the first argument is now
909f413d 90 <literal>post</literal>. All executables in this
0127336c 91 directory are executed in parallel, and execution of
19adb8a3
ZJS
92 the action is not continued until all executables
93 have finished.</para>
e2b696ee
LP
94
95 <para>Note that scripts or binaries dropped in
96 <filename>/usr/lib/systemd/system-sleep/</filename>
97 are intended for local use only and should be
98 considered hacks. If applications want to be notified
6524990f
LP
99 of system suspend/hibernation and resume there are
100 much nicer interfaces available.</para>
e2b696ee 101
0127336c 102 <para>Note that
6524990f 103 <filename>systemd-suspend.service</filename>,
19adb8a3 104 <filename>systemd-hibernate.service</filename>, and
6524990f
LP
105 <filename>systemd-hybrid-sleep.service</filename>
106 should never be executed directly. Instead, trigger
107 system sleep states with a command such as
909f413d 108 <literal>systemctl suspend</literal> or
6524990f 109 similar.</para>
630d4e14
LP
110
111 <para>Internally, this service will echo a string like
909f413d 112 <literal>mem</literal> into
630d4e14 113 <filename>/sys/power/state</filename>, to trigger the
19adb8a3
ZJS
114 actual system suspend. What exactly is written
115 where can be configured in the <literal>[Sleep]</literal>
116 section of <filename>/etc/systemd/sleep.conf</filename>.
117 See <citerefentry><refentrytitle>systemd-sleep.conf</refentrytitle><manvolnum>5</manvolnum></citerefentry>.
118 </para>
119 </refsect1>
120
121 <refsect1>
122 <title>Options</title>
123
124 <para><command>systemd-sleep</command> understands the
125 following commands:</para>
126
127 <variablelist>
128 <varlistentry>
129 <term><option>-h</option></term>
130 <term><option>--help</option></term>
131
132 <listitem><para>Print a short help
133 text and exit.</para></listitem>
134 </varlistentry>
135 <varlistentry>
136 <term><option>--version</option></term>
137
138 <listitem><para>Print the systemd version
139 identifier and exit.</para></listitem>
140 </varlistentry>
141 <varlistentry>
142 <term><option>suspend</option></term>
143 <term><option>hibernate</option></term>
144 <term><option>hybrid-sleep</option></term>
145
146 <listitem><para>Suspend, hibernate, or
147 put the system to hybrid sleep.</para>
148 </listitem>
149 </varlistentry>
150 </variablelist>
e2b696ee
LP
151 </refsect1>
152
153 <refsect1>
154 <title>See Also</title>
155 <para>
19adb8a3 156 <citerefentry><refentrytitle>systemd-sleep.conf</refentrytitle><manvolnum>5</manvolnum></citerefentry>,
e2b696ee 157 <citerefentry><refentrytitle>systemd</refentrytitle><manvolnum>1</manvolnum></citerefentry>,
0127336c
LP
158 <citerefentry><refentrytitle>systemctl</refentrytitle><manvolnum>1</manvolnum></citerefentry>,
159 <citerefentry><refentrytitle>systemd.special</refentrytitle><manvolnum>7</manvolnum></citerefentry>,
e2b696ee
LP
160 <citerefentry><refentrytitle>systemd-halt.service</refentrytitle><manvolnum>8</manvolnum></citerefentry>
161 </para>
162 </refsect1>
163
164</refentry>