[systemd-devel] Unwants

Zbigniew Jędrzejewski-Szmek zbyszek at in.waw.pl
Tue Jan 27 06:45:57 PST 2015


On Tue, Jan 27, 2015 at 01:36:41PM +0100, Lennart Poettering wrote:
> On Thu, 22.01.15 13:54, Dimitri John Ledkov (dimitri.j.ledkov at intel.com) 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?
> 
> Dependencies are always additive and coalescing currently. We don't
> track which configuration file or automatic logic created which
> dependency, and hence it is not really possible right now do reset the
> list of dependencies: we wouldn't know what to reset and what
> not. Note that in many cases dependencies can be created from "both
> sides", and if A wants some dependency on B, and B also wants it from
> A, then we coalesce it one. If now some configuration in A wants to
> reset its setting, what do we do with the request from B?
Yes, I think attempting any kind of dependency removal *from loaded
units* would be very complicated, and would require major surgery to
current unit engine. And things would become conceptually more complicated,
which we certainly don't need.

But masking of .wants/ links is something different I think. It is a
*localized* modification to a single configuration file. We currently
allow overridding of almost all configuration (units files, files in
.d directories, recently even generators), but .wants and .requires
are an exception. I think we should allow this. Apart from current
use case, it would things more consistent for the user.

For --user mode this is actually the only unprivileged way to achieve
complete overriding of system supplied units, so I'm convinced we
should allow this.

Zbyszek




> When we designed this initially this way I wasn't sure this would
> suffice, but I kinda like the simplicity of this, and interestingly
> you are the first one who wants to reset dependencies again. Which
> makes me wonder if we canot find a better solution for this?
> 
> > 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
> 
> Wat precisely is the reason for trying to do this? What are you trying
> to do here, and why?


> 
> > So, is there a way to unwant something, as an override?
> 
> Nope, currently there isn't.
> 
> Lennart
> 
> -- 
> Lennart Poettering, Red Hat
> _______________________________________________
> systemd-devel mailing list
> systemd-devel at lists.freedesktop.org
> http://lists.freedesktop.org/mailman/listinfo/systemd-devel


More information about the systemd-devel mailing list