[systemd-devel] sysv-generator weirdness for shutdown runlevels
Lennart Poettering
lennart at poettering.net
Thu May 26 14:53:31 UTC 2016
eOn Wed, 25.05.16 22:12, Francis Moreau (francis.moro at gmail.com) wrote:
> Hello,
>
> I'm starring at a chunk of code of the sysv-generator (shown below)
> for some while now and I still can't see its purpose.
>
> Here's the code taken from src/sysv-generator/sysv-generator.c:
>
> static int set_dependencies_from_rcnd(const LookupPaths *lp, Hashmap
> *all_services) {
>
> [...]
>
> } else if (de->d_name[0] == 'K' &&
> (rcnd_table[i].type ==
> RUNLEVEL_DOWN)) {
>
>
> set_ensure_allocated(&shutdown_services, NULL);
> set_put(shutdown_services, service);
> }
> [...]
>
> For simplicity sake, I removed the sanity checkings.
>
> If I parsed it correctly, it handles symlinks in rc[06].d/ such as:
> /etc/init.d/rc0.d/K50foo.
>
> In this case this adds a "Conflicts=shutdown.target" and
> "Before=shutdown.target" to the foo stub service.
I figure this can actually be dropped. We used to support early-boot
SysV services, but this support was removed quite some time ago. This
means that all units generated from sysv services have
DefaultDependencies=yes set anyway, and will thus get the
shutdown.target conflict/before lines implicitly anyway.
Would be happy to take a patch that drops the manual generation of
Conflicts= lines really...
Lennart
--
Lennart Poettering, Red Hat
More information about the systemd-devel
mailing list