SYSTEMD-SUSPEND.SERVICE(8)
๐ค systemd-suspend.service(8) โ the group chat where your laptop goes night-night
okay bestie, welcome to the systemd-suspend.service manual page (that's the manual name, we're folding it in right here at the top like a lil name tag ๐). this is the whole sleep-state saga: systemd-suspend.service, systemd-hibernate.service, systemd-hybrid-sleep.service, systemd-suspend-then-hibernate.service, and systemd-sleep. System sleep state logic, periodt. โจ
โจ NAME โจ
systemd-suspend.service, systemd-hibernate.service, systemd-hybrid-sleep.service, systemd-suspend-then-hibernate.service, systemd-sleep โ System sleep state logic ๐ค
๐ SYNOPSIS ๐
systemd-suspend.service
systemd-hibernate.service
systemd-hybrid-sleep.service
systemd-suspend-then-hibernate.service
/usr/lib/systemd/system-sleep
๐ DESCRIPTION ๐
okay so. systemd-suspend.service is a system service that gets pulled in by suspend.target, and it's the one responsible for the actual system suspend. like, the real one. no middleman. ๐
same energy for systemd-hibernate.service โ it's pulled in by hibernate.target to execute the actual hibernation. and then systemd-hybrid-sleep.service is pulled in by hybrid-sleep.target to execute hybrid hibernation with system suspend, and it's also pulled in by suspend-then-hibernate.target to execute system suspend with a timeout that will activate hibernate later. multitasking icon fr fr. ๐ฆ
immediately before entering system suspend and/or hibernation, systemd-suspend.service (and the other mentioned units, respectively) will run all executables in /usr/lib/systemd/system-sleep/ and pass two arguments to them. first argument? "pre". second argument? either "suspend", "hibernate", "hybrid-sleep", or "suspend-then-hibernate" depending on the chosen action. โจ
an environment variable called "SYSTEMD_SLEEP_ACTION" will be set and it'll contain the sleep action that is processing. this is primarily helpful for "suspend-then-hibernate", where the value of the variable will be "suspend", "hibernate", or "suspend-after-failed-hibernate" in cases where hibernation has failed. ๐ญ we've all been there.
immediately after leaving system suspend and/or hibernation, the same executables are run again, but the first argument is now "post". all executables in this directory are executed in parallel, and execution of the action is not continued until all executables have finished. no cutting the line, besties. โณ
โ ๏ธ note that user.slice will be frozen while the executables are running, so they should not attempt to communicate with any user services expecting a reply. it's giving "left on read" ๐
๐จ note that scripts or binaries dropped in /usr/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 Inhibitor Locks[1]. do it the proper way, queen. ๐
๐ note thatsystemd-suspend.service,systemd-hibernate.service,systemd-hybrid-sleep.service, andsystemd-suspend-then-hibernate.serviceshould never be executed directly. like, ever. instead, trigger system sleep with a command such assystemctl suspendorsystemctl hibernate. main character energy only through the front door, okay? ๐ชโจ
internally, this service will echo a string like "mem" into /sys/power/state, to trigger the actual system suspend. what exactly is written where can be configured in the [Sleep] section of /etc/systemd/sleep.conf or a sleep.conf.d file. see systemd-sleep.conf(5). ๐
๐ก note that by default these services freezeuser.slicewhile they run. this prevents the execution of any process in any of the user sessions while the system is entering into and resuming from sleep. thus, this prevents the hooks in/usr/lib/systemd/system-sleep/, or any other process for that matter, from communicating with any user session process during sleep. frozen. like your ex's heart. ๐ง
๐ OPTIONS ๐
systemd-sleep understands the following commands:
-h,--helpโ print a short help text and exit. short king behavior. ๐--versionโ print a short version string and exit. just the tea, no extras. โsuspend,hibernate,suspend-then-hibernate,hybrid-sleepโ suspend, hibernate, suspend then hibernate, or put the system to hybrid sleep. pick your poison, bestie, all four are iconic. ๐
Added in version 203.
๐ SEE ALSO ๐
systemd-sleep.conf(5), systemd(1), systemctl(1), systemd.special(7), systemd-halt.service(8)
๐ NOTES ๐
- Inhibitor Locks
https://systemd.io/INHIBITOR_LOCKS
and that's the whole page, bestie!! ๐ซถ this was systemd 262.1 talking, and you're reading SYSTEMD-SUSPEND.SERVICE(8) โ go forth, suspend responsibly, and never run those units directly. mwah ๐๐ธ
๐ฆ where this page comes from
- arch rolling: systemd 262.1-1 ยท LGPL-2.1-or-later AND CC0-1.0 AND GPL-2.0-or-later AND MIT-0
- ๐ girlified by deepseek-ai/DeepSeek-V4.1-Flash on : a language model's rewrite of the original, under its terms