[Pkg-sysvinit-commits] r1655 - sysvinit/trunk/debian

Petter Reinholdtsen pere at alioth.debian.org
Thu Aug 27 17:47:54 UTC 2009


Author: pere
Date: 2009-08-27 17:47:54 +0000 (Thu, 27 Aug 2009)
New Revision: 1655

Modified:
   sysvinit/trunk/debian/sysv-rc.postinst
   sysvinit/trunk/debian/sysv-rc.templates
Log:
Report the detected problems when refusing to convert to dependency based boot sequencing.

Modified: sysvinit/trunk/debian/sysv-rc.postinst
===================================================================
--- sysvinit/trunk/debian/sysv-rc.postinst	2009-08-27 15:29:31 UTC (rev 1654)
+++ sysvinit/trunk/debian/sysv-rc.postinst	2009-08-27 17:47:54 UTC (rev 1655)
@@ -45,7 +45,17 @@
   done
 }
 
+add_problematic() {
+    msg="$1"
+    if [ -z "$PROBLEMATIC" ] ; then
+	PROBLEMATIC="$msg"
+    else
+	PROBLEMATIC="$PROBLEMATIC, $msg"
+    fi
+}
+
 is_unsafe_to_activate() {
+    retval=1
     # Refuse to convert when there are obsolete init.d scripts left
     # behind, as these tend to confuse the boot sequence.
     echo "info: Checking if it is safe to convert to dependency based boot."
@@ -56,8 +66,8 @@
         if [ "$obsolete_initscripts" ]; then
             for initscript in $obsolete_initscripts; do
                 if [ -e "$initscript" ]; then
-                    echo "error: Obsolete conffile $initscript left behind by package $package"
-                    return 0
+                    retval=0
+                    add_problematic "package $package (obsolete init.d script)"
                 fi
             done
         fi
@@ -68,8 +78,8 @@
     # outdated or missing, leading to incorrect ordering.
     for package in $(dpkg -l $(dpkg -S /etc/init.d/* 2>/dev/null |
 	    cut -d: -f1 |sort -u)|grep ^rc|awk '{print $2}') ; do
-        echo "error: Removed but not purged package $package with init.d script"
-	return 0
+	retval=0
+	add_problematic "package $package (not purged)"
     done
 
     # Refuse to migrate if insserv find problems, like loops,
@@ -78,12 +88,12 @@
     insserv -nv > $logfile 2>&1 || true
     errstr='There is a loop between|loop involving service|already provided!|provides system facility|missing LSB tags'
     if egrep -q "$errstr" $logfile ; then
-	echo "error: Problems reported by insserv:"
-	egrep "$errstr" $logfile | sed 's/^/  /'
+	msg=$(egrep "$errstr" $logfile | sed 's/$/, /')
 	rm $logfile
-	return 0
+	retval=0
+	add_problematic "$msg"
     fi
-    return 1
+    return $retval
 }
 
 activate_insserv() {
@@ -112,7 +122,11 @@
 }
 
 try_to_convert() {
+    PROBLEMATIC=""
     if is_unsafe_to_activate ; then
+	# Make sure the note is seen every time
+	db_fset sysv-rc/unable-to-convert seen false
+	db_subst sysv-rc/unable-to-convert PROBLEMATIC "$PROBLEMATIC"
 	db_input critical sysv-rc/unable-to-convert || [ $? -eq 30 ]
 	db_go || true
 	return 1

Modified: sysvinit/trunk/debian/sysv-rc.templates
===================================================================
--- sysvinit/trunk/debian/sysv-rc.templates	2009-08-27 15:29:31 UTC (rev 1654)
+++ sysvinit/trunk/debian/sysv-rc.templates	2009-08-27 17:47:54 UTC (rev 1655)
@@ -31,6 +31,13 @@
 Template: sysv-rc/unable-to-convert
 Type: note
 _Description: Unable to migrate to dependency based boot system.
+ With dependency based boot sequencing, the order of boot and shutdown
+ scripts is calculated dynamically using dependency information
+ provided with each init.d script when a new package is installed.
+ This allow some long standing problems with the boot and shutdown
+ sequences to be solved, and make it possible to detect when new
+ problems are introduced into the boot and shutdown sequence.
+ .
  Please check out the migration problems manually.  Unable to migrate
  to dependency based boot sequencing until this is fixed. See
  http://wiki.debian.org/LSBInitScripts/DependencyBasedBoot for more
@@ -39,10 +46,4 @@
  question, and not with insserv and sysv-rc.  To retry the migration,
  run 'dpkg-reconfigure sysv-rc'.
  .
- With dependency based boot sequencing, the order of boot and shutdown
- scripts is calculated dynamically using dependency information
- provided with each init.d script when a new package is installed.
- This allow some long standing problems with the boot and shutdown
- sequences to be solved, and make it possible to detect when new
- problems are introduced into the boot and shutdown sequence.
-
+ These were the problems detected: ${PROBLEMATIC}




More information about the Pkg-sysvinit-commits mailing list