Bug#971713: sysstat: init or systemd file has overlapping runlevels

Trek trek00 at inbox.ru
Tue Dec 15 15:31:52 GMT 2020

On Tue, 15 Dec 2020 00:58:19 +0100
Robert Luberda <robert at debian.org> wrote:

> >> insserv: Script ssh has overlapping Default-Start and Default-Stop
> >> runlevels (2 3 4 5) and (2 3 4 5). This should be fixed.  
> What is surprising the ssh warning is shown even if I run insserv from
> the command line without giving any other arguments:
> [...]
> While the sysstat warning is shown only on upgrades.

it is because insserv scan all the init.d files on each invocation, but
it scans the rc.d links only for the ones specified by commandline

> Removing the links removes the warning as well:
> [...]
> But when I re-add the K01ssh links, 'apt install --reinstall sysstat'
> warns about ssh, and no longer about sysstat service...

this is the culprit: if the user tweaks the rc.d links, then the
overlapping warning appears, but it should not

> Oh, wait, I've just read my email from Sunday, and it looks like the
> warning on my system was always about ssh:
> [...]
> Sorry about not noticing it before, I must have been too strongly
> suggested by the Julian's original bug report :(
> So it looks like the warning says that run-level links were customized
> by a user. IMHO it would be nice if the warning message stated this
> simple fact in a more explicit way.

well, thanks to your report we found a bug in insserv :)

> I looked into insserv(8) man page before changing the script, and was
> under impression that Default-Start and Default-Stop must contain at
> least one run level, as the example given at the top of the man page
> says:
>     # Default-Start:     run_level_1 [ run_level_2 ...]
>     # Default-Stop:      run_level_1 [ run_level_2 ...]

the actual syntax may be misleading, because insserv works happily if
any of those fields are empty (or even missing)

> But if you're sure they can be empty, I will revert the change in
> sysstat's init.d script.

yes, you can safely revert it, as far i understand

@Jesse Smith: I attached a possible fix, but it slightly changes the
behavior, as now it prints the overlapping warning when loading all the
init.d scripts and not only for the ones in the commandline

this because if script_inf.default_start and stop are empty, they are
overwritten by the levels gathered from rc.d links and I do not fully
understand the implications of removing those overwrites, so I just
moved the code before this part

the second patch is for the manpage about empty fields, that are
allowed by insserv, but probably it could be explained better

please to tell me if you need some more info or work to be done :)

-------------- next part --------------
A non-text attachment was scrubbed...
Name: 0001-Check-only-LSB-header-for-overlapping-runlevels-to-f.patch
Type: text/x-patch
Size: 1712 bytes
Desc: not available
URL: <http://www.chiark.greenend.org.uk/pipermail/debian-init-diversity/attachments/20201215/1d198ccc/attachment.bin>
-------------- next part --------------
A non-text attachment was scrubbed...
Name: 0002-Added-Default-Start-and-Stop-definitions-to-insserv..patch
Type: text/x-patch
Size: 1138 bytes
Desc: not available
URL: <http://www.chiark.greenend.org.uk/pipermail/debian-init-diversity/attachments/20201215/1d198ccc/attachment-0001.bin>

More information about the Debian-init-diversity mailing list