man-pages/man8/systemd-suspend.service.8.html
2021-03-31 01:06:50 +01:00

181 lines
4.5 KiB
HTML

<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN">
<HTML><HEAD><TITLE>Man page of SYSTEMD-SUSPEND.SERVICE</TITLE>
</HEAD><BODY>
<H1>SYSTEMD-SUSPEND.SERVICE</H1>
Section: systemd-suspend.service (8)<BR>Updated: <BR><A HREF="#index">Index</A>
<A HREF="/cgi-bin/man/man2html">Return to Main Contents</A><HR>
<A NAME="lbAB">&nbsp;</A>
<H2>NAME</H2>
systemd-suspend.service, systemd-hibernate.service, systemd-hybrid-sleep.service, systemd-suspend-then-hibernate.service, systemd-sleep - System sleep state logic
<A NAME="lbAC">&nbsp;</A>
<H2>SYNOPSIS</H2>
<P>
systemd-suspend.service
<P>
systemd-hibernate.service
<P>
systemd-hybrid-sleep.service
<P>
systemd-suspend-then-hibernate.service
<P>
/lib/systemd/system-sleep
<A NAME="lbAD">&nbsp;</A>
<H2>DESCRIPTION</H2>
<P>
systemd-suspend.service
is a system service that is pulled in by
suspend.target
and is responsible for the actual system suspend. Similarly,
systemd-hibernate.service
is pulled in by
hibernate.target
to execute the actual hibernation. Finally,
systemd-hybrid-sleep.service
is pulled in by
hybrid-sleep.target
to execute hybrid hibernation with system suspend and pulled in by
suspend-then-hibernate.target
to execute system suspend with a timeout that will activate hibernate later.
<P>
Immediately before entering system suspend and/or hibernation
systemd-suspend.service
(and the other mentioned units, respectively) will run all executables in
/lib/systemd/system-sleep/
and pass two arguments to them. The first argument will be
&quot;pre&quot;, the second either
&quot;suspend&quot;,
&quot;hibernate&quot;,
&quot;hybrid-sleep&quot;, or
&quot;suspend-then-hibernate&quot;
depending on the chosen action. Immediately after leaving system suspend and/or hibernation the same executables are run, but the first argument is now
&quot;post&quot;. All executables in this directory are executed in parallel, and execution of the action is not continued until all executables have finished.
<P>
Note that scripts or binaries dropped in
/lib/systemd/system-sleep/
are intended for local use only and should be considered hacks. If applications want to react to system suspend/hibernation and resume, they should rather use the
m[blue]<B>Inhibitor interface</B>m[]<FONT SIZE="-2">[1]</FONT>.
<P>
Note that
systemd-suspend.service,
systemd-hibernate.service, and
systemd-hybrid-sleep.service
systemd-suspend-then-hibernate.service
should never be executed directly. Instead, trigger system sleep states with a command such as
&quot;systemctl suspend&quot;
or similar.
<P>
Internally, this service will echo a string like
&quot;mem&quot;
into
/sys/power/state, to trigger the actual system suspend. What exactly is written where can be configured in the
&quot;[Sleep]&quot;
section of
/etc/systemd/sleep.conf
or a
sleep.conf.d
file. See
<B><A HREF="/cgi-bin/man/man2html?5+systemd-sleep.conf">systemd-sleep.conf</A></B>(5).
<A NAME="lbAE">&nbsp;</A>
<H2>OPTIONS</H2>
<P>
<B>systemd-sleep</B>
understands the following commands:
<P>
<B>-h</B>, <B>--help</B>
<DL COMPACT><DT id="1"><DD>
Print a short help text and exit.
</DL>
<P>
<B>--version</B>
<DL COMPACT><DT id="2"><DD>
Print a short version string and exit.
</DL>
<P>
<B>suspend</B>, <B>hibernate</B>, <B>hybrid-sleep</B>, <B>suspend-then-hibernate</B>
<DL COMPACT><DT id="3"><DD>
Suspend, hibernate, suspend then hibernate, or put the system to hybrid sleep.
</DL>
<A NAME="lbAF">&nbsp;</A>
<H2>SEE ALSO</H2>
<P>
<B><A HREF="/cgi-bin/man/man2html?5+systemd-sleep.conf">systemd-sleep.conf</A></B>(5),
<B><A HREF="/cgi-bin/man/man2html?1+systemd">systemd</A></B>(1),
<B><A HREF="/cgi-bin/man/man2html?1+systemctl">systemctl</A></B>(1),
<B><A HREF="/cgi-bin/man/man2html?7+systemd.special">systemd.special</A></B>(7),
<B><A HREF="/cgi-bin/man/man2html?8+systemd-halt.service">systemd-halt.service</A></B>(8)
<A NAME="lbAG">&nbsp;</A>
<H2>NOTES</H2>
<DL COMPACT>
<DT id="4"> 1.<DD>
Inhibitor interface
<DL COMPACT><DT id="5"><DD>
<A HREF="https://www.freedesktop.org/wiki/Software/systemd/inhibit">https://www.freedesktop.org/wiki/Software/systemd/inhibit</A>
</DL>
<P>
</DL>
<HR>
<A NAME="index">&nbsp;</A><H2>Index</H2>
<DL>
<DT id="6"><A HREF="#lbAB">NAME</A><DD>
<DT id="7"><A HREF="#lbAC">SYNOPSIS</A><DD>
<DT id="8"><A HREF="#lbAD">DESCRIPTION</A><DD>
<DT id="9"><A HREF="#lbAE">OPTIONS</A><DD>
<DT id="10"><A HREF="#lbAF">SEE ALSO</A><DD>
<DT id="11"><A HREF="#lbAG">NOTES</A><DD>
</DL>
<HR>
This document was created by
<A HREF="/cgi-bin/man/man2html">man2html</A>,
using the manual pages.<BR>
Time: 00:06:17 GMT, March 31, 2021
</BODY>
</HTML>