Bug#832945: update-rc.d defaults does not respect disabled state of a sysv init script

Michael Biebl biebl at debian.org
Sat Jul 30 19:47:52 BST 2016


Am 30.07.2016 um 19:52 schrieb Felipe Sateler:
> On 29 July 2016 at 17:05, Michael Biebl <biebl at debian.org> wrote:
>> Am 29.07.2016 um 22:44 schrieb Michael Biebl:
>>> Package: init-system-helpers
>>> Version: 1.41
>>> Severity: serious
>>>
>>> Running
>>> update-rc.d foo disable
>>> update-rc.d foo defaults
>>> will create start symlinks although this should not happen for a
>>> disabled service.
>>
>> This happens when insserv is not installed, so is another regression in
>> our fallback code.
> 
> Insserv does not create new links if there are already-existing links
> for that runlevel. So I think the fix (untested) would be:
> 
> diff --git a/script/update-rc.d b/script/update-rc.d
> index cbf4339..a01ed5e 100755
> --- a/script/update-rc.d
> +++ b/script/update-rc.d
> @@ -116,15 +116,15 @@ sub make_sysv_links {
>      my ($lsb_start_ref, $lsb_stop_ref) =
> parse_def_start_stop("/etc/init.d/$scriptname");
>      foreach my $lvl (@$lsb_start_ref) {
>          make_path("/etc/rc$lvl.d");
> +        continue if glob("/etc/rc$lvl.d/[KS]??$scriptname");
>          my $l = "/etc/rc$lvl.d/S01$scriptname";
> -        unlink($l);
>          symlink("../init.d/$scriptname", $l);
>      }
> 
>      foreach my $lvl (@$lsb_stop_ref) {
>          make_path("/etc/rc$lvl.d");
> +        continue if glob("/etc/rc$lvl.d/[KS]??$scriptname");
>          my $l = "/etc/rc$lvl.d/K01$scriptname";
> -        unlink($l);
>          symlink("../init.d/$scriptname", $l);
>      }
>  }
> 
> 

I think what insserv does, is to compare the LSB header to what symlinks
 exist on the disk. If there is a difference, it does nothing at all.
Your patch behaves slightly different from what I can see.
It does the check per runlevel and not as a whole.


Regards,
Michael

-- 
Why is it that all of the instruments seeking intelligent life in the
universe are pointed away from Earth?

-------------- next part --------------
A non-text attachment was scrubbed...
Name: signature.asc
Type: application/pgp-signature
Size: 819 bytes
Desc: OpenPGP digital signature
URL: <http://alioth-lists.debian.net/pipermail/pkg-systemd-maintainers/attachments/20160730/e3f8328c/attachment-0002.sig>


More information about the Pkg-systemd-maintainers mailing list