Discussion:
Bug#971713: sysstat: init or systemd file has overlapping runlevels
Add Reply
Robert Luberda
2020-12-15 00:10:01 UTC
Reply
Permalink
Trek pisze:

Hi,
so the fix would be like the one attached to this mail
I've tried this update-rc.d -f sysstat command manually, and then I run
'apt install --reinstall sysstat', and as the result the warning about
default stop level is fixed, but the original warning about overlapping
run-levels is not.
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:

***@vox:/tmp$ sudo insserv
insserv: Script ssh has overlapping Default-Start and Default-Stop
runlevels (2 3 4 5) and (2 3 4 5). This should be fixed.
insserv: FATAL: service mountkernfs has to exist for service udev
insserv: FATAL: service mountdevsubfs has to exist for service hwclock
insserv: FATAL: service urandom has to exist for service networking
insserv: exiting now!

While the sysstat warning is shown only on upgrades.

Anyway I've just checked what the ssh links are:

***@vox:/tmp$ sudo ls -la /etc/rc*.d/*ssh*
lrwxrwxrwx 1 root root 13 2017-03-27 /etc/rc2.d/K01ssh -> ../init.d/ssh
lrwxrwxrwx 1 root root 13 2017-03-27 /etc/rc3.d/K01ssh -> ../init.d/ssh
lrwxrwxrwx 1 root root 13 2017-03-27 /etc/rc4.d/K01ssh -> ../init.d/ssh
lrwxrwxrwx 1 root root 13 2017-03-27 /etc/rc5.d/K01ssh -> ../init.d/ssh

Removing the links removes the warning as well:

***@vox:/tmp$ sudo update-rc.d -f ssh remove
insserv: Script ssh has overlapping Default-Start and Default-Stop
runlevels (2 3 4 5) and (2 3 4 5). This should be fixed.

***@vox:/tmp$ sudo insserv
insserv: FATAL: service mountkernfs has to exist for service udev
insserv: FATAL: service mountdevsubfs has to exist for service hwclock
insserv: FATAL: service urandom has to exist for service networking
insserv: exiting now!

Even apt install --reinstall sysstat does not display any warning.

But when I re-add the K01ssh links, 'apt install --reinstall sysstat'
warns about ssh, and no longer about sysstat service...

Oh, wait, I've just read my email from Sunday, and it looks like the
insserv: warning: current stop runlevel(s) (empty) of script
`sysstat' overrides LSB defaults (0 1 6).
insserv: Script ssh has overlapping Default-Start and Default-Stop
^^^
runlevels (2 3 4 5) and (2 3 4 5). This should be fixed.
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.
this instead comes from ssh, that have an empty Default-Stop too
@Robert Luberda: I ran out of ideas, your script was correct with an
empty Default-Stop field, like the ssh one!
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 ...]


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

Regards,
robert
Trek
2020-12-15 15:40:01 UTC
Reply
Permalink
On Tue, 15 Dec 2020 00:58:19 +0100
Post by Robert Luberda
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
[...]
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
Post by Robert Luberda
[...]
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
Post by Robert Luberda
Oh, wait, I've just read my email from Sunday, and it looks like the
[...]
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 :)
Post by Robert Luberda
I looked into insserv(8) man page before changing the script, and was
under impression that Default-Start and Default-Stop must contain at
# 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)
Post by Robert Luberda
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 :)

ciao!
Jesse Smith
2020-12-15 21:40:01 UTC
Reply
Permalink
On Tue, 15 Dec 2020 12:45:40 -0400
I gave the patch a test run and, while I like what it does in theory,
in practise I'm running into trouble with it. When I use the attached
patch and then run "make check" in the insserv source directory,
inssrev segfaults after about eight tests. I haven't had a chance yet
to hunt down what is causing the problem, but I'm guessing a variable
is getting used before it is given a value/initialized.
well, moving the Start_Stop_Overlap call broke the assumption that
start_levels and stop_levels are never undefined, so this additional
patch should fix the regression
make check now passes all 240 tests
thanks for the review and happy hacking! :)
Thank you for the updated patch. I have confirmed it works here and
passes all checks. I've committed the change for the upcoming 1.23.0
branch of insserv. People are welcome to test it out and, when the next
version gets published, this fix (and update to the manual page) will be
included.

- Jesse
Matthew Vernon
2021-02-19 09:00:02 UTC
Reply
Permalink
Post by Jesse Smith
On Tue, 15 Dec 2020 12:45:40 -0400
I gave the patch a test run and, while I like what it does in theory,
in practise I'm running into trouble with it. When I use the attached
patch and then run "make check" in the insserv source directory,
inssrev segfaults after about eight tests. I haven't had a chance yet
to hunt down what is causing the problem, but I'm guessing a variable
is getting used before it is given a value/initialized.
well, moving the Start_Stop_Overlap call broke the assumption that
start_levels and stop_levels are never undefined, so this additional
patch should fix the regression
make check now passes all 240 tests
thanks for the review and happy hacking! :)
Thank you for the updated patch. I have confirmed it works here and
passes all checks. I've committed the change for the upcoming 1.23.0
branch of insserv. People are welcome to test it out and, when the next
version gets published, this fix (and update to the manual page) will be
included.
Are you in a position to publish this version? insserv still has this
grave severity bug open against it, which it'd be good to resolve ASAP
before insserv gets pulled from testing...

Regards,

Matthew
Matthew Vernon
2021-02-21 23:30:01 UTC
Reply
Permalink
A new version of SysV init and innserv have been published today. The
new version of insserv (1.23.0) fixes the above issue. It can be
downloaded from here: http://download.savannah.nongnu.org/releases/sysvinit/
There is a new version of initscripts in unstable, and this is now
I don't think the new initscripts can be relevantly responsible - the
change from -5 shouldn't have affected any of this; likewise the insserv
package I uploaded was to the delayed queue, so isn't in unstable yet.

Regards,

Matthew
Matthew Vernon
2021-02-21 17:30:01 UTC
Reply
Permalink
Hi,

I've taken Trek's patches and incorporated them into an NMU which I've
pushed to delayed/5.

We may still want to get the new version into bullseye once Jesse
publishes it, but at least this way the fix for this bug will be in.

I hope that's OK!

Regards,

Matthew
Debian Bug Tracking System
2021-02-26 18:10:01 UTC
Reply
Permalink
Your message dated Fri, 26 Feb 2021 18:03:45 +0000
with message-id <E1lFhSr-00061Y-***@fasolo.debian.org>
and subject line Bug#971713: fixed in insserv 1.21.0-1.1
has caused the Debian Bug report #971713,
regarding sysstat: init or systemd file has overlapping runlevels
to be marked as done.

This means that you claim that the problem has been dealt with.
If this is not the case it is now your responsibility to reopen the
Bug report if necessary, and/or fix the problem forthwith.

(NB: If you are a system administrator and have no idea what this
message is talking about, this may indicate a serious mail system
misconfiguration somewhere. Please contact ***@bugs.debian.org
immediately.)
--
971713: https://bugs.debian.org/cgi-bin/bugreport.cgi?bug=971713
Debian Bug Tracking System
Contact ***@bugs.debian.org with problems
Joost van Baal-Ilić
2021-03-04 11:30:02 UTC
Reply
Permalink
Hi Dirk,
Hi guys,
it seems the bug from insserv now arrived in testing with the tons of repeated messages. Any chance for a fix?
insserv: Script sysstat has overlapping Default-Start and Default-Stop runlevels (2 3 4 5) and (2 3 4 5). This should be fixed.
insserv: Script sysstat has overlapping Default-Start and Default-Stop runlevels (2 3 4 5) and (2 3 4 5). This should be fixed.
This will likely get fixed automatically within 5 days from now:
https://tracker.debian.org/pkg/insserv says:

Migration status for insserv (1.21.0-1 to 1.21.0-1.1)
Too young, only 5 of 10 days old
Updating insserv fixes old bugs: #971713

Bye,

Joost

Loading...