[Pkg-sysvinit-devel] Bug#538304: update-rc.d: Should reject packages trying to install start and stop symlinks in the same runlevel

Petter Reinholdtsen pere at hungry.com
Fri Jul 24 17:42:09 UTC 2009


This patch will activate a warning when such configuration is used.
It could be a good start to get rid of it.  Eventualy, I believe we
should detect such calls before doing any changes, and reject the
update-rc.d call.

Index: debian/sysv-rc/sbin/update-rc.d
===================================================================
--- debian/sysv-rc/sbin/update-rc.d     (revision 1484)
+++ debian/sysv-rc/sbin/update-rc.d     (working copy)
@@ -292,6 +292,7 @@
 sub makelinks {
     my($t, $i);
     my @links;
+    my @otherlinks;

     if (&checklinks) {
        print " System startup links for $initd/$bn already exist.\n";
@@ -303,8 +304,12 @@

     for($t = 0; $t < 2; $t++) {
        @links = $t ? @startlinks : @stoplinks;
+       @otherlinks = ! $t ? @startlinks : @stoplinks;
        for($i = 0; $i <= $#links; $i++) {
            my $lvl = $i;
+           if (defined $otherlinks[$i]) {
+               print STDERR "update-rc.d: warning: Enabling both start and stop symlinks in runlevel $lvl!\n"
+           }
            $lvl = 'S' if ($i == 99);
            next if (!defined $links[$i] or $links[$i] eq '');
            print "   $etcd$lvl.d/$links[$i]$bn -> ../init.d/$bn\n";





More information about the Pkg-sysvinit-devel mailing list