Summary: | Suspend/Hibernate should have StopWhenUnneeded=yes | ||
---|---|---|---|
Product: | systemd | Reporter: | m8r-0s9a4g |
Component: | general | Assignee: | systemd-bugs |
Status: | RESOLVED INVALID | QA Contact: | systemd-bugs |
Severity: | normal | ||
Priority: | medium | ||
Version: | unspecified | ||
Hardware: | Other | ||
OS: | All | ||
Whiteboard: | |||
i915 platform: | i915 features: |
Description
m8r-0s9a4g
2014-06-16 07:43:44 UTC
Not following here. systemd-suspend.service terminates as soon as the suspend is complete, on its own, because it does exit(0), there's no point of adding StopWhenUnneeded=yes to it. Don't grok the problem. Your service should be able to do BindTo=systemd-suspend.service and Before=systemd-suspend.service. That way, its ExecStart= should be invoked before, and its ExecStop= after the suspend. Also note the hook directory in /usr/lib/systemd/system-sleep/. See systemd-sleep(8) for details. Looks like BindsTo=systemd-suspend.service and Before=systemd-suspend.service does what I want. I guess my confusion is why does suspend.target stay active after resuming when sleep.target doesn't? I don't think I'm the only one confused by it. The Arch wiki[1] has examples with suspend.target and sleep.target. I don't think the suspend.target ones will work as expected. [1] https://wiki.archlinux.org/index.php/Power_management#Suspend.2Fresume_service_files |
Use of freedesktop.org services, including Bugzilla, is subject to our Code of Conduct. How we collect and use information is described in our Privacy Policy.