[systemd-devel] Unwants

Dimitri John Ledkov dimitri.j.ledkov at intel.com
Thu Jan 22 06:08:17 PST 2015


On 22 January 2015 at 14:00, Zbigniew Jędrzejewski-Szmek
<zbyszek at in.waw.pl> wrote:
> On Thu, Jan 22, 2015 at 01:54:37PM +0000, Dimitri John Ledkov wrote:
>> Is there a way to remove / override wants that are specified via
>> .wants directory, .d snippet with "Wants=", or wants specified in the
>> unit itself?
>>
>> I thought that creating a symlink to /dev/null from a higher up
>> directory would disable wants dependency but it didn't:
>>
>> e.g.:
>> I was expecting for
>> /run/systemd/system/getty.target.wants/getty at tty1.service -> /dev/null
>>
>> to cancel
>>
>> /etc/systemd/system/getty.target.wants/getty at tty1.service ->
>> ../../../../usr/lib/systemd/system/getty at .service
>>
>> However i've found that the target of the symlink does not matter, and
>> thus symlinks to /dev/null in .wants directory enable the
>> dependencies.
>>
>> One can experiment with just dummy foo.target and bar.target in
>> /etc/systemd/system.
>>
>> Similarly I've tried adding .d snippet with "Wants=!unwanted.service"
>> but that only failed to load the snippet...
>>
>> So, is there a way to unwant something, as an override?
> IIRC, we had a discussion about that, but I don't remember the result.
>

If anyone has topic names / mailing-list urls i'd be glad for those to
be pointed out.

> In any case, /etc overrides /run, so your example can never work.
>

Oh, ok. But any combination of the two. E.g. for /etc to unwant from
/run then, or for /etc to unwant from /usr.

At the moment, I'm looking at packaging symlinks in .wants directories
under /usr and then allow to uninstall such a package as a means to
override the default config. Since I would like to update how the
default config is setup, without doing in /etc where I'd have to
answer "is this my old config, or user modified it and I shouldn't
touch it"

-- 
Regards,

Dimitri.

Intel Corporation (UK) Ltd. - Co. Reg. #1134945 - Pipers Way, Swindon SN3 1RJ.


More information about the systemd-devel mailing list