[Pkg-sysvinit-commits] r1761 - in sysvinit/trunk/debian: . src/sysv-rc/sbin

Petter Reinholdtsen pere at alioth.debian.org
Thu Sep 10 20:22:53 UTC 2009


Author: pere
Date: 2009-09-10 20:22:53 +0000 (Thu, 10 Sep 2009)
New Revision: 1761

Modified:
   sysvinit/trunk/debian/changelog
   sysvinit/trunk/debian/src/sysv-rc/sbin/update-rc.d
Log:
Remove information about scripts in /var/lib/update-rc.d/ when
their runlevel symlinks are removed (Closes: #545949).

Modified: sysvinit/trunk/debian/changelog
===================================================================
--- sysvinit/trunk/debian/changelog	2009-09-10 19:21:29 UTC (rev 1760)
+++ sysvinit/trunk/debian/changelog	2009-09-10 20:22:53 UTC (rev 1761)
@@ -24,6 +24,8 @@
   * Drop hurd specific dependency on libc0.3 (>= 2.3.2.ds1-12).  It is
     no longer needed according to Michael Bunk.  Patch from Michael
     Biebl.
+  * Remove information about scripts in /var/lib/update-rc.d/ when
+    their runlevel symlinks are removed (Closes: #545949).
 
  -- Petter Reinholdtsen <pere at debian.org>  Sun, 06 Sep 2009 17:13:33 +0200
 

Modified: sysvinit/trunk/debian/src/sysv-rc/sbin/update-rc.d
===================================================================
--- sysvinit/trunk/debian/src/sysv-rc/sbin/update-rc.d	2009-09-10 19:21:29 UTC (rev 1760)
+++ sysvinit/trunk/debian/src/sysv-rc/sbin/update-rc.d	2009-09-10 20:22:53 UTC (rev 1761)
@@ -10,6 +10,9 @@
 my $etcd  = "/etc/rc";
 my $notreally = 0;
 
+# Save last action to this directory
+my $archive = "/var/lib/update-rc.d";
+
 # Print usage message and die.
 
 sub usage {
@@ -50,7 +53,6 @@
 
 sub save_last_action {
     my ($script, @arguments) = @_;
-    my $archive = "/var/lib/update-rc.d";
 
     return if $notreally;
 
@@ -60,6 +62,11 @@
     rename "$archive/${script}.new", "$archive/${script}";
 }
 
+sub remove_last_action {
+    my ($script) = @_;
+    unlink "$archive/$script";
+}
+
 # Action.
 
 &usage() if ($#ARGV < 1);
@@ -88,7 +95,7 @@
 my @stoplinks;
 
 $_ = $ARGV[0];
-if    (/^remove$/)       { &checklinks ("remove"); save_last_action($bn, @orig_argv); }
+if    (/^remove$/)       { &checklinks ("remove"); remove_last_action($bn); }
 elsif (/^defaults$/)     { &defaults (@ARGV); &makelinks; save_last_action($bn, @orig_argv); }
 elsif (/^(start|stop)$/) { &startstop (@ARGV); &makelinks; save_last_action($bn, @orig_argv); }
 elsif (/^(dis|en)able$/) { &toggle (@ARGV); &makelinks; save_last_action($bn, @orig_argv); }
@@ -379,7 +386,7 @@
         if ( -f "/etc/init.d/$scriptname" ) {
             my $rc = system "insserv", @opts, "-r", $scriptname;
             if (0 == $rc && !$notreally) {
-                save_last_action($scriptname, @orig_argv);
+                remove_last_action($scriptname);
             }
             exit $rc;
         } else {
@@ -387,7 +394,7 @@
             # what to look for.
             my $rc = system "insserv", @opts;
             if (0 == $rc && !$notreally) {
-                save_last_action($scriptname, @orig_argv);
+                remove_last_action($scriptname);
             }
             exit $rc;
         }




More information about the Pkg-sysvinit-commits mailing list