[systemd-devel] Implicit unit dependency on slice might be too weak ?

David Herrmann dh.herrmann at gmail.com
Tue Sep 22 02:14:54 PDT 2015


Hi

On Tue, Sep 22, 2015 at 10:58 AM, Francis Moreau <francis.moro at gmail.com> wrote:
> Hello,
>
> On Mon, Sep 21, 2015 at 7:43 PM, David Herrmann <dh.herrmann at gmail.com> wrote:
>> Hi
>>
>> On Mon, Sep 21, 2015 at 4:50 PM, Francis Moreau <francis.moro at gmail.com> wrote:
>>> Hi,
>>>
>>> If a unit depends on a slice, a Wants=machine.slice is automatically
>>> added to the unit constraints.
>>>
>>> Why is "Requires=machine.slice" not prefered instead ?
>>
>> Usually "Wants=" is preferred as it makes the units more fail-safe.
>> Especially for slices, I cannot see why "Requires=" would be
>> beneficial. If a specific unit needs this, a simple
>> "Requires=foobar.slice" gets you what you want.
>>
>
> But what if the slice fails to start ?
>
> Will the unit asking for a specific slice (which fails to start) be
> moved into another slice ? It seems that whatever the final
> destination used by systemd, the constraints used by the "fallback"
> slice won't be correct, no ?

Correct.

You still get a big fat error on your screen and you should fix your
setup. Again, if that's no suitable, you better use "Requires=".

Thanks
David


More information about the systemd-devel mailing list