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

Petter Reinholdtsen pere at alioth.debian.org
Sat Aug 15 20:54:10 UTC 2009


Author: pere
Date: 2009-08-15 20:54:09 +0000 (Sat, 15 Aug 2009)
New Revision: 1609

Added:
   sysvinit/trunk/debian/sysv-rc.templates
Modified:
   sysvinit/trunk/debian/changelog
   sysvinit/trunk/debian/control
   sysvinit/trunk/debian/rules
   sysvinit/trunk/debian/sysv-rc.postinst
Log:
On second thought, ask before converting existing installations to dependency based boot sequencing.  This code do not work yet.

Modified: sysvinit/trunk/debian/changelog
===================================================================
--- sysvinit/trunk/debian/changelog	2009-08-13 21:28:11 UTC (rev 1608)
+++ sysvinit/trunk/debian/changelog	2009-08-15 20:54:09 UTC (rev 1609)
@@ -1,5 +1,7 @@
 sysvinit (2.87dsf-3) UNRELEASED; urgency=low
 
+  * XXX Do not release.  debconf handling in sysv-rc do not work yet.
+
   [ Petter Reinholdtsen ]
   * Drop execution of files in /etc/rc.boot from sysv-rc.  This feature
     have been obsolete since before 1999.  Remove the rc.boot(5) manual
@@ -17,7 +19,8 @@
   * Migrate the code to enable dependency based boot sequencing from
     the insserv package to sysv-rc.  Depend on insserv (>> 1.12.0-10)
     for this.  Migration to dependency based boot sequencing is now a
-    one-way process, enabled when it is safe to do so.  Checks
+    one-way process, enabled when it is safe to do so, with a debconf
+    question asked during upgrades.  Checks
     previously done by update-bootsystem-insserv are now only done
     once in sysv-rc postinst (Closes: #538934).  The change make it
     possible to remove both sysv-rc and insserv (Closes: #538959) if

Modified: sysvinit/trunk/debian/control
===================================================================
--- sysvinit/trunk/debian/control	2009-08-13 21:28:11 UTC (rev 1608)
+++ sysvinit/trunk/debian/control	2009-08-15 20:54:09 UTC (rev 1609)
@@ -42,7 +42,7 @@
 Conflicts: file-rc
 Replaces: file-rc
 Suggests: sysv-rc-conf, bum
-Depends: sysvinit-utils (>= 2.86.ds1-62), insserv (>> 1.12.0-10), initscripts (>= 2.86.ds1-63)
+Depends:  ${misc:Depends}, sysvinit-utils (>= 2.86.ds1-62), insserv (>> 1.12.0-10), initscripts (>= 2.86.ds1-63)
 Description: System-V-like runlevel change mechanism
  This package provides support for the System-V like system
  for booting, shutting down and changing runlevels,

Modified: sysvinit/trunk/debian/rules
===================================================================
--- sysvinit/trunk/debian/rules	2009-08-13 21:28:11 UTC (rev 1608)
+++ sysvinit/trunk/debian/rules	2009-08-15 20:54:09 UTC (rev 1609)
@@ -330,6 +330,7 @@
 	install -o root -g root -m 755 debian/sysv-rc/saveconfig \
 		$(tmp)/usr/share/doc/sysv-rc/saveconfig
 	dpkg-gencontrol -psysv-rc -P$(tmp) -isp
+	dh_installdebconf -Ninitscripts -Nsysv-rc
 	dh_md5sums -Ninitscripts -Nsysv-rc
 	dpkg --build $(tmp) ..
 	rm -rf $(tmp)

Modified: sysvinit/trunk/debian/sysv-rc.postinst
===================================================================
--- sysvinit/trunk/debian/sysv-rc.postinst	2009-08-13 21:28:11 UTC (rev 1608)
+++ sysvinit/trunk/debian/sysv-rc.postinst	2009-08-15 20:54:09 UTC (rev 1609)
@@ -2,6 +2,9 @@
 
 set -e
 
+. /usr/share/debconf/confmodule
+db_version 2.0
+
 now=`date +%Y%m%dT%H%M`
 logdir=/var/lib/insserv
 backupfile="$logdir/bootscripts-$now.tar.gz"
@@ -68,18 +71,6 @@
 }
 
 activate_insserv() {
-    if is_unsafe_to_activate ; then
-	cat <<EOF
-info: Please check out this manually.
-info: Refusing to convert boot sequence until this is fixed
-info: See http://wiki.debian.org/LSBInitScripts/DependencyBasedBoot
-info: for more information on how to solve these issues.  Most likely,
-info: it is a bug in the binary package with the init.d script in
-info: question, and not with insserv and sysv-rc.
-EOF
-	return 1
-    fi
-
     echo "info: Backing up existing boot scripts in $backupfile"
     (cd /etc; tar zcf $backupfile init.d rc*.d)
 
@@ -101,6 +92,38 @@
     return 0
 }
 
+try_to_convert() {
+    lastver=$1
+    if is_unsafe_to_activate ; then
+	cat <<EOF
+error: Unable to enable dependency based boot system.
+info: Please check out this manually.
+info: Refusing to convert boot sequence until this is fixed
+info: See http://wiki.debian.org/LSBInitScripts/DependencyBasedBoot
+info: for more information on how to solve these issues.  Most likely,
+info: it is a bug in the binary package with the init.d script in
+info: question, and not with insserv and sysv-rc.
+EOF
+	return 1
+    else
+	# Ask if the legacy boot sequence should be converted to
+	# dependency based, making 'yes' the default.
+	db_set sysv-rc/convert-legacy true
+	db_input high sysv-rc/convert-legacy || [ $? -eq 30 ]
+	db_go || true
+	db_get sysv-rc/convert-legacy || true
+	if [ true = "$RET" ] ; then
+	    if activate_insserv ; then
+		echo "success: Enabled dependency based boot system."
+	    else
+		echo "error: Something failed while converting."
+	    fi
+	else
+	    echo "warning: Not converting legacy boot sequence"
+	fi
+    fi
+}
+
 # Remove divert if it exist.  It was dropped in insserv 1.12.0-11 and
 # sysvinit 2.87dsf-3, 2009-07-29.
 check_divert false /usr/sbin/update-rc.d /usr/sbin/update-rc.d-insserv
@@ -110,16 +133,13 @@
 	if [ -f /var/lib/insserv/using-insserv ] ; then
 	    : # Already enabled, do not need to do anything
 	else
-	    if activate_insserv ; then
-		echo "success: Enabled dependency based boot system."
-		: # All OK
-	    else
-		echo "error: Unable to enable dependency based boot system."
-	    fi
+	    try_to_convert "$2"
 	fi
 	;;
     *)
 	;;
 esac
 
+db_stop
+
 #DEBHELPER#

Added: sysvinit/trunk/debian/sysv-rc.templates
===================================================================
--- sysvinit/trunk/debian/sysv-rc.templates	                        (rev 0)
+++ sysvinit/trunk/debian/sysv-rc.templates	2009-08-15 20:54:09 UTC (rev 1609)
@@ -0,0 +1,21 @@
+# These templates have notbeen reviewed by the debian-l10n-english
+# team
+#
+# If modifications/additions/rewording are needed, please ask
+# debian-l10n-english at lists.debian.org for advice.
+#
+# Even minor modifications require translation updates and such
+# changes should be coordinated with translators and reviewers.
+
+Template: sysv-rc/convert-legacy
+Type: boolean
+_Description: Migrate legacy boot sequence to dependency based sequencing?
+ This is a one way migration, where the old way of specifying boot
+ sequence numbers for init.d scripts is made obsolete, and the
+ dependency information provided in each init.d is used to generate the
+ sequence numbers.
+ .
+ If you see this question, it mean that a test checking for dependency
+ loops, obsolete scripts and other potential problems found no error
+ and believe it is safe to convert the current system to use
+ dependency based boot sequencing.




More information about the Pkg-sysvinit-commits mailing list