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

Francis Moreau francis.moro at gmail.com
Thu May 26 05:49:10 UTC 2016


Hello Michael,

On Wed, May 25, 2016 at 11:08 PM, Michael Biebl <mbiebl at gmail.com> wrote:
> Hm, I've already given you the answer on IRC, so I'm not sure why you
> ask them again.
>

Indee and thank you for that.

But you also told me that /etc/init.d/rc0.d isn't supported by Debian,
and my question is about this runlevel in particular.

> 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.
>

So let's take an example. Please note that I'm really not sure what's
the expected behavior of sysvinit itself, and finding some
documentation/specifications about that is pretty hard.

I want my "foo" sysv service to be executed at shutdown. So I install
the following symlink:

  /etc/init.d/rc0.d/S50foo

The sysv-generator will add a "WantedBy/Before=poweroff.target" to the foo stub.

The chunk of code in my initial post adds support of the following symlink:

 /etc/init.d/rc0.d/K50foo

It adds "Conflicts/Before=shutdown.target" to foo stub.

So if both symlinks are installed (I don't see why this is useful and
hence why the generator has some code to handle that), foo stub has
the following constraints:

WantedBy/Before=poweroff.target
Conflicts/Before=shutdown.target

and to me that's not useful since in my understand it's equivalent to a nop.

Thanks.


More information about the systemd-devel mailing list