[Initscripts-ng-commits] r936 - in /trunk/src/insserv/debian: changelog insserv.config insserv.postinst

pere at users.alioth.debian.org pere at users.alioth.debian.org
Sun Jul 26 18:40:02 UTC 2009


Author: pere
Date: Sun Jul 26 18:40:00 2009
New Revision: 936

URL: http://svn.debian.org/wsvn/initscripts-ng/?sc=1&rev=936
Log:
Move all code from insserv.config to insserv.postist and remove
insserv.config to make sure update-bootsystem-insserv is available
and working when it is needed to test if it is safe to migrate to
dependency based boot sequencing.

Removed:
    trunk/src/insserv/debian/insserv.config
Modified:
    trunk/src/insserv/debian/changelog
    trunk/src/insserv/debian/insserv.postinst

Modified: trunk/src/insserv/debian/changelog
URL: http://svn.debian.org/wsvn/initscripts-ng/trunk/src/insserv/debian/changelog?rev=936&op=diff
==============================================================================
--- trunk/src/insserv/debian/changelog (original)
+++ trunk/src/insserv/debian/changelog Sun Jul 26 18:40:00 2009
@@ -10,6 +10,12 @@
   [ Kel Modderman ]
   * Just use `update-bootsystem-insserv check' to check if changing to
     dependency based boot is safe in insserv.config debconf script.
+
+  [ Petter Reinholdtsen ]
+  * Move all code from insserv.config to insserv.postist and remove
+    insserv.config to make sure update-bootsystem-insserv is available
+    and working when it is needed to test if it is safe to migrate to
+    dependency based boot sequencing.
 
  -- Kel Modderman <kel at otaku42.de>  Mon, 27 Jul 2009 00:48:18 +1000
 

Modified: trunk/src/insserv/debian/insserv.postinst
URL: http://svn.debian.org/wsvn/initscripts-ng/trunk/src/insserv/debian/insserv.postinst?rev=936&op=diff
==============================================================================
--- trunk/src/insserv/debian/insserv.postinst (original)
+++ trunk/src/insserv/debian/insserv.postinst Sun Jul 26 18:40:00 2009
@@ -3,6 +3,8 @@
 set -e
 
 . /usr/share/debconf/confmodule
+
+db_version 2.0
 
 flagfile=/var/lib/insserv/using-insserv
 
@@ -20,6 +22,60 @@
 	fi
     esac
 }
+
+############################## Ask the qeustion (insserv.config) #################################
+#
+# insserv.config moved here to be able to call update-bootsystem-insserv
+#
+if [ "$1" = configure ] && [ -z "$2" ]; then
+    set +e
+    db_fget insserv/enable seen
+    err=$?
+    set -e
+
+    case $err in
+       0)
+           if [ true = "$RET" ]; then
+               db_get insserv/enable
+               if [ true = "$RET" ] && \
+                   ! check_divert status /usr/sbin/update-rc.d \
+                   /usr/sbin/update-rc.d-insserv ; then
+                   # debconf value has been seen and the value is true, but the
+                   # on disk state is false. No previous package version has
+                   # given as second argument, therefore the value must have
+                   # been preseeded before initial installation. Exit.
+                   exit
+               fi
+           fi
+           ;;
+       10)
+           # insserv/enable seen does not exist
+           ;;
+       *)
+           echo "db_fget exited with $err" >&2
+           exit $err
+           ;;
+    esac
+fi
+
+
+# Only update the default from the status on disk if we are already
+# installed, and not on first time install, to allow preseeding.
+if [ -e /usr/sbin/update-rc.d-insserv ] ; then
+    if check_divert status /usr/sbin/update-rc.d \
+	/usr/sbin/update-rc.d-insserv ; then
+	db_set insserv/enable true
+    elif update-bootsystem-insserv check ; then
+	# No problems with the current boot scripts, should be safe to enable
+	db_set insserv/enable true
+    else
+	db_set insserv/enable false
+    fi
+fi
+
+db_input medium insserv/enable || [ $? -eq 30 ]
+db_go || true
+############################ Process the qeustion (insserv.config) ###############################
 
 case "$1" in
     configure)




More information about the Initscripts-ng-commits mailing list