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">
6 This file is part of systemd.
8 Copyright 2012 Lennart Poettering
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.
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.
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/>.
24 <refentry id="systemd-suspend.service">
27 <title>systemd-suspend.service</title>
28 <productname>systemd</productname>
32 <contrib>Developer</contrib>
33 <firstname>Lennart</firstname>
34 <surname>Poettering</surname>
35 <email>lennart@poettering.net</email>
41 <refentrytitle>systemd-suspend.service</refentrytitle>
42 <manvolnum>8</manvolnum>
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>
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>
61 <title>Description</title>
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
75 <para>Immediately before entering system suspend
77 <filename>systemd-suspend.service</filename> (and the
78 other mentioned units, respectively) will run all
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
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>
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
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>
117 <title>See Also</title>
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>