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
diff --git a/debian/changelog b/debian/changelog
index 9b6450e..ab9811c 100644
--- a/debian/changelog
+++ b/debian/changelog
@@ -1,3 +1,12 @@
+insserv (1.21.0-1.1) unstable; urgency=medium
+
+  * Non-maintainer upload
+  * Apply patches from Trek to only check LSB headers for overlapping
+    run-levels and document Default-{Start,Stop} more clearly
+    (Closes: #971713)
+
+ -- Matthew Vernon <matt...@debian.org>  Sun, 21 Feb 2021 17:13:07 +0000
+
 insserv (1.21.0-1) unstable; urgency=medium
 
   * New upstream release
diff --git a/debian/patches/patches-from-trek-closes-971713.patch b/debian/patches/patches-from-trek-closes-971713.patch
new file mode 100644
index 0000000..99d78f9
--- /dev/null
+++ b/debian/patches/patches-from-trek-closes-971713.patch
@@ -0,0 +1,76 @@
+From: Matthew Vernon <matt...@debian.org>
+Date: Sun, 21 Feb 2021 17:07:48 +0000
+X-Dgit-Generated: 1.21.0-1.1 25129a77868f74aca504d43faf9d2bfe375468dc
+Subject: Patches from Trek (Closes: #971713)
+
+Only check LSB headers for overlapping runlevels (so you don't get an
+error if the admin has adjusted runlevels), and also document
+Default-Start and Default-Stop more clearly.
+
+---
+
+--- insserv-1.21.0.orig/insserv.8.in
++++ insserv-1.21.0/insserv.8.in
+@@ -97,6 +97,11 @@ execute insserv directly unless you know
+ 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 started.
+ @@BEGIN_SUSE@@
+ Please note, that the
+ .B Default\-Stop
+@@ -104,6 +109,10 @@ are ignored in SuSE Linux, because the S
+ uses a differential link scheme (see
+ .IR init.d (7)).
+ @@ELSE_SUSE@@
++The same applies for its counterpart
++.B Default\-Stop
++with the only difference that the script is stopped.
++.PP
+ Please be aware that the line
+ .sp 1
+ .in +1l
+--- insserv-1.21.0.orig/insserv.c
++++ insserv-1.21.0/insserv.c
+@@ -2737,6 +2737,8 @@ boolean Start_Stop_Overlap(char *start_l
+    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 */
+@@ -3573,6 +3575,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 +3749,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];
diff --git a/debian/patches/series b/debian/patches/series
index e28fa8f..13ebfb3 100644
--- a/debian/patches/series
+++ b/debian/patches/series
@@ -3,3 +3,4 @@
 warn_in_ignore_mode.patch
 0004-Fix-spurious-warnings-about-unknown-virtual-dependen.patch
 0005-Fix-spelling-error-in-manpage.patch
+patches-from-trek-closes-971713.patch
diff --git a/insserv.8.in b/insserv.8.in
index 9008b5f..a370deb 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 started.
 @@BEGIN_SUSE@@
 Please note, that the
 .B Default\-Stop
@@ -104,6 +109,10 @@ are ignored in SuSE Linux, because the SuSE boot script concept
 uses a differential link scheme (see
 .IR init.d (7)).
 @@ELSE_SUSE@@
+The same applies for its counterpart
+.B Default\-Stop
+with the only difference that the script is stopped.
+.PP
 Please be aware that the line
 .sp 1
 .in +1l
diff --git a/insserv.c b/insserv.c
index f949f05..b6cdee0 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 */
@@ -3573,6 +3575,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 +3749,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];

Reply via email to