Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
Background
I noticed the service declared
[Unit] After=multi-user.target
and would fail to restart following asystemd-sleep
events. The service correctly starts on a fresh boot, but would not be triggered by asleep.target
trigger (suspend, hibernate, hybrid, etc...).The service should only start after a successful boot (at-least
multi-user.target
), but still requires a dependency trigger onsleep.target
to restart on wake.Changes
Full support for restarting after
systemd-sleep
should just requireAfter=sleep.target
added to the service's[Unit]
section. This change should safely and reliably request OpenLinkHub to resume aftersleep.target
without effecting systemd's critical chain. This should avoid having to be overly complex in handling theboot->sleep->wake->shutdown
cycle, and for systemd to "want" the service to start on boot (not require it) and to also restart the service after resuming from any sleep state.