[systemd-devel] Starting a unit on resume from suspend/hibernate

Dimitrios Apostolou jimis at gmx.net
Thu Apr 2 10:28:59 PDT 2015


On Thu, 2 Apr 2015, Andrei Borzenkov wrote:

> В Thu, 2 Apr 2015 18:43:40 +0200 (CEST)
> Dimitrios Apostolou <jimis at gmx.net> пишет:
>
>> Conflicts=sleep.target
>> WantedBy=multi-user.target sleep.target
>
> These are mutually conflicting. One one hand Conflicts says to stop your
> unit when sleep.target gets started, on the other hand WantedBy says to
> start your unit when sleep.target gets started. Only one can win.

Indeed, but I was assuming that combined with "after" they could co-exist, 
starting the unit after the dependency has started and stopped. And if it 
was a problem I would expect a message, since it's easy to detect.

Anyway even removing the Conflicts line does not help. 
"systemctl enable" still does not install the symlink, and manually 
installing the symlink does not change anything.

>
> As workaround you can start your unit
> in /usr/lib/systemd/sytem-sleep script post-resume.
>

Is it possible to keep the logic in the unit file?


Thanks,
Dimitris


More information about the systemd-devel mailing list