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