[systemd-devel] after=user.slice not enforced

Cédric BRINER cedric.briner at unige.ch
Wed Nov 23 12:46:35 UTC 2016


Hi,

>> But this has not the expected impact. We were wishing with the
>> "After=user.slice", that the stop sapRunning will occur before any user
>> commands are stopped.
>>
>> Does using "After=user.slice" propagate also on all the
>> *children*. That way we could ensure that our stop services'
>> commmand is launched as the first ever before any kill ?
>
> No it does not. Unit dependencies apply to each unit individually and
> they do not propagate
That confirm my thoughts!

>> The question still remain for us, how can we do to have a daemon
>> launched by hand, that can be handled by systemd for its stopping.
>
> You cannot. Either systemd execs your daemon and then also stops
> it. Or you exec it, and then you stop it. There's no concept for
> making systemd adopt foreign services...
Many thanks. What you said is very clear and helpfull.

> (Not sure I grok what you want to do, but do note that "systemd-run"
> may be used to invoke binaries as services without prepping a unit
> file for it, instead providing all the definitions on the command
> line)
I'll get to a look at this also.

> Lennart
cED

-- 
Cédric BRINER, Ing. EPFL & HES
+41 (0)22 / 379 71 83


More information about the systemd-devel mailing list