[systemd-devel] [PATCH] sysv-generator: do not generate 'Wants' symlinks to generated service files that will be shadowed by a native unit.

Zbigniew Jędrzejewski-Szmek zbyszek at in.waw.pl
Wed Jul 16 05:22:50 PDT 2014


On Wed, Jul 16, 2014 at 01:00:18PM +0200, Jon Severinsson wrote:
> onsdagen den 16 juli 2014 12:48:23 skrev du:
> > On Wed, Jul 16, 2014 at 11:57 AM, Jon Severinsson <jon at severinsson.net> wrote:
> > > +        /* Do not generate 'Wants' symlinks to the generated service file if it
> > > +         * will be shadowed by an existing native unit, as the symlinks would
> > > +         * not be shadowed but would pull the native unit instead. */
> > > +        if (native_unit_exists(lp, s->name))
> > > +                return 0;
> > > +
> > 
> > Any reason that we should not just put the native_unit_exists check in
> > enumerate_sysv instead and skip generating a unit at all?
> 
> That was indeed my first attempt [1], but doing so confused
> set_dependencies_from_rcnd (which I papered over by removing the log_warning),
> would change the ordering of non-LSB init scripts (as fix_order would not know
> about the shadowed init script), and seems to have been rejected by Lennart
> Poettering already [2]. 
> 
> [1] https://github.com/jonseverinsson/debian-systemd/blob/3375f1cc4faf3dec61974af5a06b48004fdfaaeb/debian/patches/Do-not-generate-systemd-units-from-sysv-init-scripts.patch
> [2] http://lists.freedesktop.org/archives/systemd-devel/2014-July/020924.html

In the light of your patch, the idea of *not* generating units at all seems
like the best option.

When we have both sysv and native:

- Currently we always generate compat units, but like you say, their dependencies
  are summed, but the gist is taken from the native one.

- With your patch, we would generate the unit file itself, which would be shadowed,
  but not its dependencies, so it would be useless anyway.

- Third option is to skip wrapper unit generation at all

IMHO, one is wrong, two is confusing.

Zbyszek


More information about the systemd-devel mailing list