summaryrefslogtreecommitdiff
path: root/man/systemd-suspend.service.xml
diff options
context:
space:
mode:
authorZach Smith <z@zxmth.us>2021-01-07 18:06:30 -0800
committerYu Watanabe <watanabe.yu+github@gmail.com>2021-01-09 18:11:01 +0900
commitae463e4ef2c8c3ba18abc58315ac0daea8407c03 (patch)
treea0dc6282a23a02137772793f2e05afccfcb6a641 /man/systemd-suspend.service.xml
parent83f0ff1eda6ea995cd078d54ae5601370dbbd9d2 (diff)
downloadsystemd-ae463e4ef2c8c3ba18abc58315ac0daea8407c03.tar.gz
systemd-sleep: Set SYSTEMD_SLEEP_ACTION for systemd-sleep hooks.
When suspend-then-hibernate is called, hooks have no ability to determine which stage of the request is being handled; they only see 'pre' and 'post' with the verb 'suspend-then-hibernate'. This change introduces an environment variable called SYSTEMD_SLEEP_ACTION that contains the name of the action that is processing: 'suspend', 'hibernate', 'hybrid-sleep', or 'suspend-after-failed-hibernate'.
Diffstat (limited to 'man/systemd-suspend.service.xml')
-rw-r--r--man/systemd-suspend.service.xml5
1 files changed, 4 insertions, 1 deletions
diff --git a/man/systemd-suspend.service.xml b/man/systemd-suspend.service.xml
index e4a6de548f..c525a3bda2 100644
--- a/man/systemd-suspend.service.xml
+++ b/man/systemd-suspend.service.xml
@@ -56,7 +56,10 @@
<literal>pre</literal>, the second either
<literal>suspend</literal>, <literal>hibernate</literal>,
<literal>hybrid-sleep</literal>, or <literal>suspend-then-hibernate</literal>
- depending on the chosen action.
+ depending on the chosen action. An environment variable called <literal>SYSTEMD_SLEEP_ACTION</literal>
+ will be set and contain the sleep action that is processing. This is primarily helpful for
+ <literal>suspend-then-hibernate</literal> where the value of the variable will be <literal>suspend</literal>, <literal>hibernate</literal>,
+ or <literal>suspend-after-failed-hibernate</literal> in cases where hibernation has failed.
Immediately after leaving system suspend and/or hibernation the
same executables are run, but the first argument is now
<literal>post</literal>. All executables in this directory are