]> git.ipfire.org Git - thirdparty/systemd.git/blame - man/systemd-suspend.service.xml
sd-event: define a new PREPARING state
[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"
12b42c76 3 "http://www.oasis-open.org/docbook/xml/4.2/docbookx.dtd">
e2b696ee
LP
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 25<refentry id="systemd-suspend.service"
798d3a52
ZJS
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>
12b42c76 59 <para><filename>/usr/lib/systemd/system-sleep</filename></para>
798d3a52
ZJS
60 </refsynopsisdiv>
61
62 <refsect1>
63 <title>Description</title>
64
65 <para><filename>systemd-suspend.service</filename> is a system
66 service that is pulled in by <filename>suspend.target</filename>
67 and is responsible for the actual system suspend. Similarly,
68 <filename>systemd-hibernate.service</filename> is pulled in by
69 <filename>hibernate.target</filename> to execute the actual
70 hibernation. Finally,
71 <filename>systemd-hybrid-sleep.service</filename> is pulled in by
72 <filename>hybrid-sleep.target</filename> to execute hybrid
73 hibernation with system suspend.</para>
74
75 <para>Immediately before entering system suspend and/or
76 hibernation <filename>systemd-suspend.service</filename> (and the
77 other mentioned units, respectively) will run all executables in
12b42c76 78 <filename>/usr/lib/systemd/system-sleep/</filename> and pass two
798d3a52
ZJS
79 arguments to them. The first argument will be
80 <literal>pre</literal>, the second either
81 <literal>suspend</literal>, <literal>hibernate</literal>, or
82 <literal>hybrid-sleep</literal> depending on the chosen action.
83 Immediately after leaving system suspend and/or hibernation the
84 same executables are run, but the first argument is now
85 <literal>post</literal>. All executables in this directory are
86 executed in parallel, and execution of the action is not continued
87 until all executables have finished.</para>
88
89 <para>Note that scripts or binaries dropped in
12b42c76 90 <filename>/usr/lib/systemd/system-sleep/</filename> are intended
798d3a52
ZJS
91 for local use only and should be considered hacks. If applications
92 want to be notified of system suspend/hibernation and resume,
93 there are much nicer interfaces available.</para>
94
95 <para>Note that
96 <filename>systemd-suspend.service</filename>,
97 <filename>systemd-hibernate.service</filename>, and
98 <filename>systemd-hybrid-sleep.service</filename>
99 should never be executed directly. Instead, trigger system sleep
100 states with a command such as <literal>systemctl suspend</literal>
101 or similar.</para>
102
103 <para>Internally, this service will echo a string like
104 <literal>mem</literal> into <filename>/sys/power/state</filename>,
105 to trigger the actual system suspend. What exactly is written
106 where can be configured in the <literal>[Sleep]</literal> section
12b42c76 107 of <filename>/etc/systemd/sleep.conf</filename> or a
798d3a52
ZJS
108 <filename>sleep.conf.d</filename> file. See
109 <citerefentry><refentrytitle>systemd-sleep.conf</refentrytitle><manvolnum>5</manvolnum></citerefentry>.
110 </para>
111 </refsect1>
112
113 <refsect1>
114 <title>Options</title>
115
116 <para><command>systemd-sleep</command> understands the
117 following commands:</para>
118
119 <variablelist>
120 <xi:include href="standard-options.xml" xpointer="help" />
121 <xi:include href="standard-options.xml" xpointer="version" />
122
123 <varlistentry>
124 <term><option>suspend</option></term>
125 <term><option>hibernate</option></term>
126 <term><option>hybrid-sleep</option></term>
127
128 <listitem><para>Suspend, hibernate, or put the system to
129 hybrid sleep.</para>
130 </listitem>
131 </varlistentry>
132 </variablelist>
133 </refsect1>
134
135 <refsect1>
136 <title>See Also</title>
137 <para>
138 <citerefentry><refentrytitle>systemd-sleep.conf</refentrytitle><manvolnum>5</manvolnum></citerefentry>,
139 <citerefentry><refentrytitle>systemd</refentrytitle><manvolnum>1</manvolnum></citerefentry>,
140 <citerefentry><refentrytitle>systemctl</refentrytitle><manvolnum>1</manvolnum></citerefentry>,
141 <citerefentry><refentrytitle>systemd.special</refentrytitle><manvolnum>7</manvolnum></citerefentry>,
142 <citerefentry><refentrytitle>systemd-halt.service</refentrytitle><manvolnum>8</manvolnum></citerefentry>
143 </para>
144 </refsect1>
e2b696ee
LP
145
146</refentry>