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

Jon Severinsson jon at severinsson.net
Wed Jul 16 04:00:18 PDT 2014


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


More information about the systemd-devel mailing list