[Initscripts-ng-commits] r640 - in /trunk/src/insserv/debian: changelog patches/00list patches/42_loopnochangemsg.dpatch run-testsuite

pere at users.alioth.debian.org pere at users.alioth.debian.org
Sat Feb 23 10:32:17 UTC 2008


Author: pere
Date: Sat Feb 23 10:32:17 2008
New Revision: 640

URL: http://svn.debian.org/wsvn/initscripts-ng/?sc=1&rev=640
Log:
  * Add test to verify that introducing a loop will not change the boot
    sequence, but make insserv exit with an error.
  * Added patch 42_loopnochangemsg to change the message printed when
    a loop is detected, to let the user know that the boot sequence is
    untouched.

Added:
    trunk/src/insserv/debian/patches/42_loopnochangemsg.dpatch
Modified:
    trunk/src/insserv/debian/changelog
    trunk/src/insserv/debian/patches/00list
    trunk/src/insserv/debian/run-testsuite

Modified: trunk/src/insserv/debian/changelog
URL: http://svn.debian.org/wsvn/initscripts-ng/trunk/src/insserv/debian/changelog?rev=640&op=diff
==============================================================================
--- trunk/src/insserv/debian/changelog (original)
+++ trunk/src/insserv/debian/changelog Sat Feb 23 10:32:17 2008
@@ -1,6 +1,10 @@
 insserv (1.11.0-5) UNRELEASED; urgency=low
 
-  * 
+  * Add test to verify that introducing a loop will not change the boot
+    sequence, but make insserv exit with an error.
+  * Added patch 42_loopnochangemsg to change the message printed when
+    a loop is detected, to let the user know that the boot sequence is
+    untouched.
 
  -- Petter Reinholdtsen <pere at debian.org>  Thu, 21 Feb 2008 09:39:30 +0100
 

Modified: trunk/src/insserv/debian/patches/00list
URL: http://svn.debian.org/wsvn/initscripts-ng/trunk/src/insserv/debian/patches/00list?rev=640&op=diff
==============================================================================
--- trunk/src/insserv/debian/patches/00list (original)
+++ trunk/src/insserv/debian/patches/00list Sat Feb 23 10:32:17 2008
@@ -5,5 +5,6 @@
 33_nosuse_scripts
 40_segfault_virtprov
 41_cleansystem
+42_loopnochangemsg
 50_sign_warning
 51_overwrite_output

Added: trunk/src/insserv/debian/patches/42_loopnochangemsg.dpatch
URL: http://svn.debian.org/wsvn/initscripts-ng/trunk/src/insserv/debian/patches/42_loopnochangemsg.dpatch?rev=640&op=file
==============================================================================
--- trunk/src/insserv/debian/patches/42_loopnochangemsg.dpatch (added)
+++ trunk/src/insserv/debian/patches/42_loopnochangemsg.dpatch Sat Feb 23 10:32:17 2008
@@ -1,0 +1,20 @@
+#! /bin/sh /usr/share/dpatch/dpatch-run
+## 40_loopnochangemsg.dpatch by Petter Reinholdtsen
+
+Make it more obvious that introducing a loop will not change the
+existing boot sequence.  Thanks to Frans Pop for the rationale for
+this change.
+
+ at DPATCH@
+
+--- insserv-1.11.0.orig/insserv.c
++++ insserv-1.11.0/insserv.c
+@@ -2647,7 +2647,7 @@
+     follow_all();
+ 
+     if (is_loop_detected() && !ignore)
+-	error("exiting now!\n");
++	error("exiting without changing boot order!\n");
+ 
+     /*
+      * Re-order some well known scripts to get

Modified: trunk/src/insserv/debian/run-testsuite
URL: http://svn.debian.org/wsvn/initscripts-ng/trunk/src/insserv/debian/run-testsuite?rev=640&op=diff
==============================================================================
--- trunk/src/insserv/debian/run-testsuite (original)
+++ trunk/src/insserv/debian/run-testsuite Sat Feb 23 10:32:17 2008
@@ -737,8 +737,8 @@
 check_script_present 2 okscript
 }
 
+##########################################################################
 test_incorrect_stopscripts() {
-##########################################################################
 echo
 echo "info: Check if insserv add stop symlinks for scripts that"
 echo "info: currently do not have them."
@@ -779,6 +779,89 @@
 ${severity}_script_not_present 0 script
 ${severity}_script_not_present 1 script
 check_script_not_present 1 nostopscript
+}
+##########################################################################
+test_newbug_keepoldorder() {
+echo
+echo "info: Verify that introducing a loop in a working system do"
+echo "info: not change the order of the scripts currently on disk."
+echo
+
+rm -rf $initddir
+mkdir -p $initddir
+
+insertscript mountall <<'EOF' || true
+### BEGIN INIT INFO
+# Provides:          mountall
+# Required-Start:
+# Required-Stop:
+# Default-Start:     S
+# Default-Stop:
+### END INIT INFO
+EOF
+
+insertscript needlocal <<'EOF' || true
+### BEGIN INIT INFO
+# Provides:          needlocal
+# Required-Start:    $local_fs
+# Required-Stop:     $local_fs
+# Default-Start:     S
+# Default-Stop:      6
+### END INIT INFO
+EOF
+
+insertscript needremote <<'EOF' || true
+### BEGIN INIT INFO
+# Provides:          needremote
+# Required-Start:    $remote_fs needlocal
+# Required-Stop:     $remote_fs needlocal
+# Default-Start:     S
+# Default-Stop:      6
+### END INIT INFO
+EOF
+
+insertscript needboth <<'EOF' || true
+### BEGIN INIT INFO
+# Provides:          needboth
+# Required-Start:    needlocal needremote
+# Required-Stop:     needlocal needremote
+# Default-Start:     S
+# Default-Stop:      6
+### END INIT INFO
+EOF
+
+list_rclinks
+
+check_order S mountall needlocal
+check_order S mountall needremote
+check_order S mountall needboth
+check_order S needlocal needremote
+check_order S needlocal needboth
+check_order S needremote needboth
+
+# Then introduce buggy dependencies in an existing script
+set +C
+addscript needboth <<'EOF' || true
+### BEGIN INIT INFO
+# Provides:          needboth
+# Required-Start:    $remote_fs
+# Required-Stop:     $remote_fs
+# X-Start-Before:    $local_fs
+# Default-Start:     S
+# Default-Stop:      6
+### END INIT INFO
+EOF
+set -C
+
+echo "info: calling insserv after introducing a bug in script needboth"
+insserv_reg needboth || true
+
+check_order S mountall needlocal
+check_order S mountall needremote
+check_order S mountall needboth
+check_order S needlocal needremote
+check_order S needlocal needboth
+check_order S needremote needboth
 }
 ##########################################################################
 
@@ -795,3 +878,4 @@
 test_removal
 test_segfault_virtfac
 test_incorrect_stopscripts
+test_newbug_keepoldorder




More information about the Initscripts-ng-commits mailing list