Bug#879771: init-system-helpers: update-rc.d falsly creates K-symlinks on installation which breaks switching init systems later

Daniel Reichelt debian at nachtgeist.net
Wed Oct 25 17:13:39 BST 2017

Package: init-system-helpers
Version: 1.50
Severity: important
Tags: patch


Assume this environment:

- debootstrap sid
- chroot apt-get install openssh-server

With init-system-helpers <1.50 you would now find S-symlinks in
etc/rc?.d. However with init-system-helpers 1.50, you'll see erroneously
created K-symlinks - which doesn't matter, systemd being used for init -

...if you were now to switch the init system to sysv-rc or openrc,
update-rc.d would see the kill-symlinks, think they had been disabled by
the user and not touch them any further. This most likely leaves any
server system unusable after a reboot, ifupdown (/etc/init.d/networking)
or any other init-script-carrying package being affected as well.

Please find attached a patch for the update-rc.d script.

The initial discussion is available at [1].



[1] https://lists.debian.org/debian-devel/2017/10/msg00439.html
-------------- next part --------------
--- init-system-helpers-1.50/script/update-rc.d	2017-10-13 01:16:13.000000000 +0200
+++ patched/scriptsupdate-rc.d	2017-10-25 17:59:18.290021026 +0200
@@ -110,7 +110,7 @@
     # for "defaults", parse Default-{Start,Stop} and create these links
     my ($lsb_start_ref, $lsb_stop_ref) = parse_def_start_stop("/etc/init.d/$scriptname");
-    my $start = $action = "defaults-disabled" ? "K" : "S";
+    my $start = $action eq "defaults-disabled" ? "K" : "S";
     foreach my $lvl (@$lsb_start_ref) {
         my $l = "/etc/rc$lvl.d/${start}01$scriptname";

More information about the Pkg-systemd-maintainers mailing list