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

2021-02-21 Thread Matthew Vernon

On 21/02/2021 22:30, Vincent Lefevre wrote:

On 2021-02-21 14:06:20 -0400, Jesse Smith wrote:

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
much worse, as I get many identical warning messages:


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



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

2021-02-21 Thread Vincent Lefevre
On 2021-02-21 14:06:20 -0400, Jesse Smith wrote:
> 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
much worse, as I get many identical warning messages:

[...]
Setting up initscripts (2.96-6) ...
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.
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.
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.
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.
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.
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.
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.
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.
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.
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.
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.
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.
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.
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.

-- 
Vincent Lefèvre  - Web: 
100% accessible validated (X)HTML - Blog: 
Work: CR INRIA - computer arithmetic / AriC project (LIP, ENS-Lyon)



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

2021-02-21 Thread Jesse Smith
On 2021-02-19 4:38 a.m., Matthew Vernon wrote:
> On 15/12/2020 21:34, Jesse Smith wrote:
>> On 2020-12-15 5:04 p.m., Trek wrote:
>>> On Tue, 15 Dec 2020 12:45:40 -0400
>>> Jesse Smith  wrote:
>>>
 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...


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/

- Jesse



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

2021-02-19 Thread Matthew Vernon

On 15/12/2020 21:34, Jesse Smith wrote:

On 2020-12-15 5:04 p.m., Trek wrote:

On Tue, 15 Dec 2020 12:45:40 -0400
Jesse Smith  wrote:


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



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

2020-12-15 Thread Trek
On Tue, 15 Dec 2020 12:45:40 -0400
Jesse Smith  wrote:

> 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! :)
>From 4a3b1e90f23792b6f640e8d9bc28c334cafce843 Mon Sep 17 00:00:00 2001
From: Trek 
Date: Tue, 15 Dec 2020 20:00:18 +0100
Subject: [PATCH 3/3] Skip overlapping check on empty runlevels

---
 insserv.c | 2 ++
 1 file changed, 2 insertions(+)

diff --git a/insserv.c b/insserv.c
index dbd3202..b7e1d8f 100644
--- a/insserv.c
+++ b/insserv.c
@@ -2737,6 +2737,8 @@ boolean Start_Stop_Overlap(char *start_levels, char *stop_levels)
int string_index = 0;
char *found;
 
+   if (!start_levels || !stop_levels) return false;
+
while (start_levels[string_index])   /* go to end of string */
{
if (start_levels[string_index] != ' ') /* skip spaces */
-- 
2.20.1



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

2020-12-15 Thread Jesse Smith
On 2020-12-15 5:04 p.m., Trek wrote:
> On Tue, 15 Dec 2020 12:45:40 -0400
> Jesse Smith  wrote:
>
>> 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



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

2020-12-15 Thread Trek
On Tue, 15 Dec 2020 00:58:19 +0100
Robert Luberda  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 :)

ciao!
>From d6704148edd51cbb972a9e61e9d165a9e266be45 Mon Sep 17 00:00:00 2001
From: Trek 
Date: Tue, 15 Dec 2020 16:17:54 +0100
Subject: [PATCH 1/2] Check only LSB header for overlapping runlevels to fix
 Debian bug #971713

---
 insserv.c | 15 ---
 1 file changed, 8 insertions(+), 7 deletions(-)

diff --git a/insserv.c b/insserv.c
index 1e43bf0..dbd3202 100644
--- a/insserv.c
+++ b/insserv.c
@@ -3573,6 +3573,14 @@ int main (int argc, char *argv[])
 		if (script_inf.stop_after && script_inf.stop_after != empty) {
 			reversereq(service, REQ_SHLD|REQ_KILL, script_inf.stop_after);
 		}
+
+overlap = Start_Stop_Overlap(script_inf.default_start, script_inf.default_stop);
+if (overlap)
+{
+warn("Script `%s' has overlapping Default-Start and Default-Stop runlevels (%s) and (%s). This should be fixed.\n",
+  d->d_name, script_inf.default_start, script_inf.default_stop);
+}
+
 		/*
 		 * Use information from symbolic link structure to
 		 * check if all services are around for this script.
@@ -3739,13 +3747,6 @@ int main (int argc, char *argv[])
 	}
 #endif /* not SUSE */
 
-overlap = Start_Stop_Overlap(script_inf.default_start, script_inf.default_stop);
-if (overlap)
-{
-warn("Script %s has overlapping Default-Start and Default-Stop runlevels (%s) and (%s). This should be fixed.\n",
-  d->d_name, script_inf.default_start, script_inf.default_stop);
-}
-
 	if (isarg && !defaults && !del) {
 	if (argr[curr_argc]) {
 		char * ptr = argr[curr_argc];
-- 
2.20.1

>From fa303693753e774adc3ad1d34679d346b4beddaa Mon Sep 17 00:00:00 2001
From: Trek 
Date: Tue, 15 Dec 2020 16:16:12 +0100
Subject: [PATCH 2/2] Added Default-Start and Stop definitions to insserv.8

---
 insserv.8.in | 9 +
 1 file changed, 9 insertions(+)

diff --git a/insserv.8.in b/insserv.8.in
index b79385a..5faa46e 100644
--- a/insserv.8.in
+++ b/insserv.8.in
@@ -97,6 +97,11 @@ execute insserv directly unless you know exactly what you're doing, doing so
 may render your boot system inoperable.
 .B update\-rc.d
 is the recommended interface for managing init scripts.
+.PP
+The
+.B Default\-Start
+keyword declares on which runlevels the script must be started. An empty
+value means the script will never be st

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

2020-12-15 Thread Jesse Smith



On 2020-12-15 11:31 a.m., Trek wrote:
> @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 :)

Thanks for taking a look at this and sending in the patch.

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.

The output from the test run is included at the bottom of this e-mail.

If you could please take a look at it and make sure the new insserv code
passes the "make check" tests, I'll give it another test run here and
get the new patch merged upstream.

- Jesse



info: test normal boot sequence scripts, and their order

insserv: Could not read script nolsbheader: No such file or directory
insserv: warning: script 'nolsbheader' missing LSB tags
insserv: Could not read script nolsbheader: Success
insserv: warning: script 'nolsbheader' missing LSB tags
suite: line 104: 11856 Segmentation fault  $insserv $debug -c
$insconf -i $insservdir -p $initddir -o $overridedir $script
success: 0 test executed, 0 nonfatal tests failed.
make: *** [Makefile:165: check] Error 139



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

2020-12-14 Thread Robert Luberda
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:

robert@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:

robert@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:

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

robert@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
warning on my system was always about ssh:
>> 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



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

2020-12-14 Thread Trek
On Mon, 14 Dec 2020 03:54:28 +0100
Lorenzo  wrote:

> if you are searching in the source under /debian directory, the code
> that you are looking for will be written by dh-installinit in place of
> the #DEBHEPLER# placeholder, during the build of the package.

@Lorenzo oh yeah, many thanks :)

so the fix would be like the one attached to this mail

but reading the init.d script I see that it does not stop anything, so
an empty Default-Stop should be correct

what I really don't understand now it's from where those messages come
from:

> insserv: Script sysstat has overlapping Default-Start and
> Default-Stop runlevels (2 3 4 5) and (2 3 4 5). This should be fixed.

running insserv on a script with an empty Default-Stop field does not
print this message, at least with buster and sid versions

reading the source, it could set an empty Default-Stop to the value of
Default-Start, but only when compiled with the -DSUSE flag enabled:

  https://sources.debian.org/src/insserv/1.21.0-1/insserv.c/#L3727

and this flag is not enabled on debian builds


> insserv: Script ssh has overlapping Default-Start and Default-Stop
> runlevels (2 3 4 5) and (2 3 4 5). This should be fixed.

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!

Actually I'm running a buster installation, but using the sid insserv
binary it does not show this issue, so I can't debug further for now

ciao!
diff --git a/debian/sysstat.postinst b/debian/sysstat.postinst
index f4730d0..3ea1596 100644
--- a/debian/sysstat.postinst
+++ b/debian/sysstat.postinst
@@ -114,6 +114,11 @@ if [ "$1" = "configure" ] ; then
 --slave /usr/share/man/man1/sar.1.gz sar.1.gz \
 /usr/share/man/man1/sar.sysstat.1.gz
 fi
+
+# new Default-Stop (see #971713)
+if dpkg --compare-versions "$2" le '12.4.1-2'; then
+update-rc.d -f sysstat remove
+fi
 fi
 
 #DEBHELPER#


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

2020-12-13 Thread Lorenzo
On Sun, 13 Dec 2020 19:44:01 +0100
Trek  wrote:

> 
> on new installations, simply adding the correct levels (0 1 6) to the
> script should fix the bug, but to fix on upgrades you should remove
> those links before running insserv, that is adding something like that
> to postinst inside the configure step:
> 
>   # new Default-Stop (see #971713)
>   if dpkg --compare-versions "$2" le '12.4.0-2'; then
>  update-rc.d -f sysstat remove
>   fi
> 
> this will also remove any tweaking done by user, that should be
> annotated inside the NEWS.Debian file
> 
> I would like to provide you a patch, but I can't find where the init.d
> file is enabled inside the sysstat postinst, that should be:
> 
>   update-rc.d sysstat defaults
> 
> ciao!
> 

Hi,

if you are searching in the source under /debian directory, the code
that you are looking for will be written by dh-installinit in place of
the #DEBHEPLER# placeholder, during the build of the package.
To find out what the postinst will look like just compare the one in the
source with the one in the deb package in the archive.

Lorenzo



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

2020-12-13 Thread Trek
On Sun, 13 Dec 2020 11:03:57 +0100
Robert Luberda  wrote:

> sysstat's init.d has the following lines in /etc/init.d/sysstat
> # Default-Start: 2 3 4 5
> # Default-Stop:
> I'm not sure how empty Default-Stop is interpreted, so I've just tried

it seems to me that on empty Default-Stop the runlevels will be copied
from Default-Start, but this is not an issue, just to better understand


> to change it to:
> # Default-Stop: 0 1 6

this seems correct


> As a result insserv displays two warnings instead of one:

before explaining the error messages, remember that init scripts and
their links are configuration files, like (almost) everything else
under /etc


> insserv: warning: current stop runlevel(s) (empty) of script `sysstat'
> overrides LSB defaults (0 1 6).

it is saying that the current stop runlevels (the /etc/rc*.d/*sysstat
links) are overriding the ones described by the LSB header (inside
the /etc/init.d/sysstat script)


> insserv: Script ssh has overlapping Default-Start and Default-Stop
> runlevels (2 3 4 5) and (2 3 4 5). This should be fixed.

the end result is that the rc*.d links are unchanged and the runlevels
still inconsistent


> As a maintainer of sysstat I have no idea what else I can do to fix
> the warning. It seems to me there is some bug in insserv. As the bug
> affects my package, and  according to the bug report "any package
> that has init.d file", I'm setting severity of this report to grave.

on new installations, simply adding the correct levels (0 1 6) to the
script should fix the bug, but to fix on upgrades you should remove
those links before running insserv, that is adding something like that
to postinst inside the configure step:

  # new Default-Stop (see #971713)
  if dpkg --compare-versions "$2" le '12.4.0-2'; then
 update-rc.d -f sysstat remove
  fi

this will also remove any tweaking done by user, that should be
annotated inside the NEWS.Debian file

I would like to provide you a patch, but I can't find where the init.d
file is enabled inside the sysstat postinst, that should be:

  update-rc.d sysstat defaults

ciao!



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

2020-12-13 Thread Robert Luberda
reassign 971713 insserv 1.21.0-1
severity 971713 grave
affects 971713 sysstat
thanks

Julian Gilbey writes:
> Package: sysstat
> Version: 12.4.0-1
> Severity: normal
> 
> When installing any package that has an init.d file, I get the
> following warning message about sysstat:
> 
> insserv: Script sysstat has overlapping Default-Start and Default-Stop
> runlevels (2 3 4 5) and (2 3 4 5). This should be fixed.


sysstat's init.d has the following lines in /etc/init.d/sysstat

# Default-Start: 2 3 4 5
# Default-Stop:

I'm not sure how empty Default-Stop is interpreted, so I've just tried
to change it to:
# Default-Stop: 0 1 6

As a result insserv displays two warnings instead of one:

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.

As a maintainer of sysstat I have no idea what else I can do to fix the
warning. It seems to me there is some bug in insserv. As the bug affects
my package, and  according to the bug report "any package that has
init.d file", I'm setting severity of this report to grave.

Oh, reinstalling the package does not fix the warnings either:

robert@vox:~/TEMP/sysstat$ grep Default-Stop /etc/init.d/sysstat
# Default-Stop:  0 1 6
robert@vox:~/TEMP/sysstat$ LC_ALL=C sudo dpkg -i
sysstat_12.4.1-1~_amd64.deb
(Reading database ... 315689 files and directories currently installed.)
Preparing to unpack sysstat_12.4.1-1~_amd64.deb ...
Unpacking sysstat (12.4.1-1~) over (12.4.1-1~) ...
Setting up sysstat (12.4.1-1~) ...
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.
robert@vox:~/TEMP/sysstat$ grep Default-Stop /etc/init.d/sysstat
# Default-Stop:  0 1 6
robert@vox:~/TEMP/sysstat$ ls -la /etc/{init.d,rc*}/*sysstat
-rwxr-xr-x 1 root root 1593 12-13 10:03 /etc/init.d/sysstat
lrwxrwxrwx 1 root root   17 12-13 10:01 /etc/rc2.d/S03sysstat ->
../init.d/sysstat
lrwxrwxrwx 1 root root   17 12-13 10:01 /etc/rc3.d/S03sysstat ->
../init.d/sysstat
lrwxrwxrwx 1 root root   17 12-13 10:01 /etc/rc4.d/S03sysstat ->
../init.d/sysstat
lrwxrwxrwx 1 root root   17 12-13 10:01 /etc/rc5.d/S03sysstat ->
../init.d/sysstat

Also please note that sysstat's debian/rules uses the following lines,
but I'm not sure if this information is relevant or not:

override_dh_installinit-arch:
dh_installinit --no-start --no-restart-after-upgrade
--no-stop-on-upgrade

override_dh_installsystemd-arch:
dh_installsystemd --no-start --no-restart-after-upgrade
--no-stop-on-upgrade

BTW. I don't use insserv, I've installed it today, and I've seen these
messages during installation:

Konfigurowanie pakietu insserv (1.21.0-1) ...
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!

I don't know if they are related or not. I've checked that
/etc/init.d/ssh also contains empty Default-Stop line.


Regards,
Robert



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

2020-10-05 Thread Julian Gilbey
Package: sysstat
Version: 12.4.0-1
Severity: normal

When installing any package that has an init.d file, I get the
following warning message about sysstat:

insserv: Script sysstat has overlapping Default-Start and Default-Stop
runlevels (2 3 4 5) and (2 3 4 5). This should be fixed.

Best wishes,

   Julian