]> git.ipfire.org Git - thirdparty/systemd.git/commit - src/sleep/sleep.c
systemd-sleep: Set SYSTEMD_SLEEP_ACTION for systemd-sleep hooks.
authorZach Smith <z@zxmth.us>
Fri, 8 Jan 2021 02:06:30 +0000 (18:06 -0800)
committerYu Watanabe <watanabe.yu+github@gmail.com>
Sat, 9 Jan 2021 09:11:01 +0000 (18:11 +0900)
commitae463e4ef2c8c3ba18abc58315ac0daea8407c03
treea0dc6282a23a02137772793f2e05afccfcb6a641
parent83f0ff1eda6ea995cd078d54ae5601370dbbd9d2
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'.
man/systemd-suspend.service.xml
src/sleep/sleep.c