[systemd-devel] sysv-generator weirdness for shutdown runlevels

Michael Biebl mbiebl at gmail.com
Wed May 25 21:08:09 UTC 2016


Hm, I've already given you the answer on IRC, so I'm not sure why you
ask them again.

The K symlinks determine whether a service needs an explicit stop
request on shutdown (i.e. Conflicts/Before: shutdown.target).

That's exactly how sysvinit also worked. If there was a K symlink in
rc0 and rc6, the service is stopped via /etc/init.d/foo stop.

Not sure what's unclear about that.

2016-05-25 22:12 GMT+02:00 Francis Moreau <francis.moro at gmail.com>:
> 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.
>
> What exactly the point to do that specially ? which sysvinit behavior
> systemd is try to mimic ?
>
> Thanks.
> --
> Francis
> _______________________________________________
> systemd-devel mailing list
> systemd-devel at lists.freedesktop.org
> https://lists.freedesktop.org/mailman/listinfo/systemd-devel



-- 
Why is it that all of the instruments seeking intelligent life in the
universe are pointed away from Earth?


More information about the systemd-devel mailing list