[systemd-devel] sysv-generator weirdness for shutdown runlevels
Francis Moreau
francis.moro at gmail.com
Thu May 26 06:25:03 UTC 2016
On Thu, May 26, 2016 at 8:15 AM, Andrei Borzenkov <arvidjaar at gmail.com> wrote:
> On Thu, May 26, 2016 at 8:49 AM, Francis Moreau <francis.moro at gmail.com> wrote:
>>
>> 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.
>>
>
> This is classical garbage in - garbage out, unless you can demonstrate
> valid use case for something that has to be both started *and* stopped
> at the same time.
Well yes that's not usefull, so I'm wondering why systemd has code to
deal with this weid case specially since by default all stubs will
have a Conflicts/Before=shutdown.target.
So even if /etc/init.d/rc0.d/K50foo is not installed,
/etc/init.d/rc0.d/S50foo will have no effect.
--
Francis
More information about the systemd-devel
mailing list