control: tags -1 +confirmed +help +upstream +patch

[2019-07-24 14:12] Lorenz <lorenzo.r...@gmail.com>
> Control: severity -1 normal
>
> Ok, here is what I've found out; to reproduce the issue you need to
> disable with update-rc.d a script that has an empty ' Default-Stop: ' field
> in the LSB header.
> [...]

Yes, I reproduced.

> This is a minor issue, but still i have few suggestions:
>
> 1. the message looks like an error, but insserv exits 0, so i guess it' a
> warning,
>     maybe it should be ' insserv: warning: Script ssh has ...'
> 2. disabling a service is a legit action and insserv already prints a
> warning about
>     overriding LSB defaults, so what is this warning about (what is to be
> fixed)?
>     Is an empty ' Default-Stop: ' field a bug, or it's something else?

This check is about LSB headers, where some runlevel is listed both in
Default-Start and Default-Stop. It is really serious.  But behaviour you
are reporing is false-positive. There is no need to change message --
only to make sure it is printed in apporiate situations.

I prepared patch that fix problem at hand (I believe), but I am not sure
that it does not introduce problems in another cases. The whole point is
that `script_inf.default_stop' value gets overrided around
insserv.c:3698, so I moved overlap check up. Jesse, can you please take
a look?

By the way, `if (!service)' conditional is always true -- `service'
variable gets initialized to `0' and is not modified before this
conditional.

diff --git a/insserv.c b/insserv.c
index 0c638dd..fa02b23 100644
--- a/insserv.c
+++ b/insserv.c
@@ -3475,6 +3475,12 @@ int main (int argc, char *argv[])
            }           /* !findservice(&guess, script_inf.provides) */
        }
 
+       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 guessed service to find it within the the runlevels
         * (by using the list from the first scan for script locations).
@@ -3733,13 +3739,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];

-- 
Note, that I send and fetch email in batch, once in a few days.
Please, mention in body of your reply when you add or remove recepients.

Reply via email to