[Pkg-sysvinit-commits] r1109 - in sysvinit/trunk/debian: . sysv-rc/etc/init.d

pere at alioth.debian.org pere at alioth.debian.org
Tue Dec 25 18:42:32 UTC 2007


Author: pere
Date: 2007-12-25 18:42:32 +0000 (Tue, 25 Dec 2007)
New Revision: 1109

Modified:
   sysvinit/trunk/debian/changelog
   sysvinit/trunk/debian/sysv-rc/etc/init.d/rc
Log:
  * Change how init.d/rc call scripts, to make sure sourced scripts
    get the correct argument string.  It is still not safe to source
    scripts, as some of them use exit and terminate the boot.

Modified: sysvinit/trunk/debian/changelog
===================================================================
--- sysvinit/trunk/debian/changelog	2007-12-24 13:09:21 UTC (rev 1108)
+++ sysvinit/trunk/debian/changelog	2007-12-25 18:42:32 UTC (rev 1109)
@@ -4,6 +4,9 @@
 
   * Change XS-Vcs-Svn to Vcs-Svn as the control flags are official now.
   * Add Vcs-Browser flag in debian/control, documenting the browsable source.
+  * Change how init.d/rc call scripts, to make sure sourced scripts
+    get the correct argument string.  It is still not safe to source
+    scripts, as some of them use exit and terminate the boot.
 
  -- Petter Reinholdtsen <pere at debian.org>  Mon, 24 Dec 2007 14:07:51 +0100
 

Modified: sysvinit/trunk/debian/sysv-rc/etc/init.d/rc
===================================================================
--- sysvinit/trunk/debian/sysv-rc/etc/init.d/rc	2007-12-24 13:09:21 UTC (rev 1108)
+++ sysvinit/trunk/debian/sysv-rc/etc/init.d/rc	2007-12-25 18:42:32 UTC (rev 1109)
@@ -75,7 +75,6 @@
 # Stub to do progress bar ticks (for splash programs) on startup
 #
 startup_progress() {
-    $@
     step=$(($step + $step_change))
     progress=$(($step * $progress_size / $num_steps + $first_step))
     $debug splash_progress "$progress" || true
@@ -101,16 +100,19 @@
 			case "$script" in
 			  *.sh)
 				if [ "." = "$sh" ] ; then
-					set "$action"
 					RC_SAVE_PATH="$PATH"
-					startup_progress $debug . "$script"
+					set -- "$action"
+					$debug . "$script"
 					PATH="$RC_SAVE_PATH"
+					startup_progress
 				else
-					startup_progress $debug $sh "$script" $action
+					$debug $sh "$script" $action
+					startup_progress
 				fi
 				;;
 			  *)
-				startup_progress $debug "$script" $action &
+				$debug "$script" $action &
+				startup_progress
 				backgrounded=1
 				;;
 			esac
@@ -135,10 +137,11 @@
 			for script in $scripts ; do
 				case "$script" in
 				  *.sh)
-					set "$action"
 					RC_SAVE_PATH="$PATH"
-					startup_progress $debug . "$script"
+					set -- "$action"
+					$debug . "$script"
 					PATH="$RC_SAVE_PATH"
+					startup_progress
 					;;
 				  *)
 					newscripts="$newscripts $script"
@@ -152,7 +155,8 @@
 		# hwclock.sh scripts should not be executed from
 		# within startpar.  The .sh hack above make this
 		# problem irrelevant. [pere 2005-09-10]
-		[ -n "$scripts" ] && startup_progress $debug startpar -a $action $scripts
+		[ -n "$scripts" ] && $debug startpar -a $action $scripts
+		startup_progress
 	}
 	;;
   none|*)
@@ -169,16 +173,19 @@
 			case "$script" in
 			  *.sh)
 				if [ "." = "$sh" ] ; then
+					RC_SAVE_PATH="$PATH"
 					set "$action"
-					RC_SAVE_PATH="$PATH"
-					startup_progress $debug . "$script"
+					$debug . "$script"
 					PATH="$RC_SAVE_PATH"
+					startup_progress
 				else
-					startup_progress $debug $sh "$script" $action
+					$debug $sh "$script" $action
+					startup_progress
 				fi
 				;;
 			  *)
-				startup_progress $debug "$script" $action
+				$debug "$script" $action
+				startup_progress
 				;;
 			esac
 		done




More information about the Pkg-sysvinit-commits mailing list