[Initscripts-ng-commits] r343 - in /trunk/src/insserv/debian: changelog update-bootsystem-insserv

pere at users.alioth.debian.org pere at users.alioth.debian.org
Sun Dec 30 12:25:14 UTC 2007


Author: pere
Date: Sun Dec 30 12:25:14 2007
New Revision: 343

URL: http://svn.debian.org/wsvn/initscripts-ng/?sc=1&rev=343
Log:
  * UNRELEASED
  * Try to make disabling code more robust by using trick used by
    sysvinit once to recover the boot sequence settings.

Modified:
    trunk/src/insserv/debian/changelog
    trunk/src/insserv/debian/update-bootsystem-insserv

Modified: trunk/src/insserv/debian/changelog
URL: http://svn.debian.org/wsvn/initscripts-ng/trunk/src/insserv/debian/changelog?rev=343&op=diff
==============================================================================
--- trunk/src/insserv/debian/changelog (original)
+++ trunk/src/insserv/debian/changelog Sun Dec 30 12:25:14 2007
@@ -1,3 +1,11 @@
+insserv (1.09.0-7) unstable; urgency=low
+
+  * UNRELEASED
+  * Try to make disabling code more robust by using trick used by
+    sysvinit once to recover the boot sequence settings.
+
+ -- Petter Reinholdtsen <pere at debian.org>  Sun, 30 Dec 2007 12:39:33 +0100
+
 insserv (1.09.0-6) unstable; urgency=low
 
   * Update patch 20_overrides to let scripts without an LSB header

Modified: trunk/src/insserv/debian/update-bootsystem-insserv
URL: http://svn.debian.org/wsvn/initscripts-ng/trunk/src/insserv/debian/update-bootsystem-insserv?rev=343&op=diff
==============================================================================
--- trunk/src/insserv/debian/update-bootsystem-insserv (original)
+++ trunk/src/insserv/debian/update-bootsystem-insserv Sun Dec 30 12:25:14 2007
@@ -25,6 +25,33 @@
       service=$2
       mv $target/etc/rc$runlevel.d/$link $target/etc/rc$runlevel.d/K$seq$service
   done
+}
+
+# Recreate sysv boot sequence by calling the postinst for all packages
+# with init.d scripts, to get them to call update-rc.d again.
+regenerate_sysv_sequence() {
+    packages="`dpkg -S /etc/init.d/*|cut -d: -f1|sort -u`"
+
+    for p in $packages ; do
+        # Make sure it is installed
+	if dpkg --get-selections $p | grep -qw install ; then
+            # Only fix packages with init.d scripts
+	    if dpkg -L $p | grep -q /etc/init.d/ ; then
+		brokenpackages="$brokenpackages $p"
+	    fi
+	fi
+    done
+
+    # Remove the old sequence
+    find /etc/rc[S0123456].d -type l -print0 | xargs -0 rm
+
+    # As the sysv-rc update-rc.d script do not check dependencies, it
+    # is enough to run through these scripts once.
+    for p in $brokenpackages ; do
+	echo "Running package $p postinst"
+	DEBCONF_FRONTEND=noninteractive	\
+	    /var/lib/dpkg/info/$p.postinst configure
+    done
 }
 
 if [ restore = "$1" ] ; then
@@ -63,7 +90,8 @@
     else
 	rm "$logdir/current.list"
 	echo "error: Unable to restore the boot sequence.  Invalid backup."
-	exit 1
+	echo "error: Trying to recover by reconfiguring all packages with init.d scripts."
+	regenerate_sysv_sequence
     fi
 else
     insserv -nv > $logfile 2>&1




More information about the Initscripts-ng-commits mailing list