[systemd-devel] Unwants
Zbigniew Jędrzejewski-Szmek
zbyszek at in.waw.pl
Thu Jan 22 06:00:28 PST 2015
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.
In any case, /etc overrides /run, so your example can never work.
zbyszek
More information about the systemd-devel
mailing list