[Pkg-sysvinit-devel] Bug#386500: update-rc.d deletes links on upgrades

Petter Reinholdtsen pere at hungry.com
Fri Sep 8 09:35:29 UTC 2006


tags 386500 + pending patch confirmed
thanks

I am able to reproduce the problem.  And I must say, wow, that was a
scary bug.  And if I should believe the svn changelog for the script,
it has been there forever, forever here meaning since before the svn
repository was created 2005-09-10. :)

I believe this patch solve the problem, by making sure checklink() do
_not_ reomve symlinks unless asked to do so.  Please test and let me
know if it solve the problem for you.  With this patch, I am no longer
able to reproduce it myself.

Index: debian/sysv-rc/sbin/update-rc.d
===================================================================
--- debian/sysv-rc/sbin/update-rc.d     (revisjon 856)
+++ debian/sysv-rc/sbin/update-rc.d     (arbeidskopi)
@@ -113,10 +113,11 @@
                print "   $fn is not a link to ../init.d/$bn; not removing\n";
                next;
            }
-           print "   $etcd$i.d/$_\n";
-           next if ($notreally);
-           unlink ("$etcd$i.d/$_") ||
-               die("update-rc.d: unlink: $!\n");
+           if (!$notreally && defined $_[0] && $_[0] eq 'remove') {
+               print "   $etcd$i.d/$_\n";
+               unlink ("$etcd$i.d/$_") ||
+                   die("update-rc.d: unlink: $!\n");
+           }
        }
        closedir(DIR);
     }




More information about the Pkg-sysvinit-devel mailing list