From ArchWiki
Revision as of 15:47, 25 March 2014 by Progandy (talk | contribs) (Proper configuration for systemd, without changing files in /usr/lib)
(diff) ← Older revision | Latest revision (diff) | Newer revision → (diff)
Jump to navigation Jump to search

Systemd integration

I believe the systemd integration is not thought out very well. I'll describe what I think should be there. An even better solution would be to rewrite uswsusp, but I have zero interest in that.

Disclaimer: I didn't test it, but in theory this configuration is sound.

  • Create this executable script
[ x"$1" = x"hibernate" -o x"$1" = x"hybrid-sleep"] || exit 1
/usr/bin/run-parts --regex .\* -a pre -a "$1" -- /usr/lib/systemd/system-sleep
if [ x"$1" = x"hibernate" ]; then
# always run post scripts in order to possibly restore settings altered in pre script.
/usr/bin/run-parts --regex .\*  --reverse -a post -a "$1" -- /usr/lib/systemd/system-sleep
exit $result
  • Create these files with all missing directories:
ExecStart=/usr/local/lib/ hibernate
ExecStart=/usr/local/lib/ hybrid-sleep