--- rc.orig	2005-08-21 19:20:27.000000000 +0100
+++ rc	2005-08-22 21:41:18.000000000 +0100
@@ -11,6 +11,7 @@
 #
 # Author:	Miquel van Smoorenburg <miquels@cistron.nl>
 #		Bruce Perens <Bruce@Pixar.com>
+#		Adrian Bridgett <bridgett@dyadic.com>
 #
 # Version:	@(#)rc  2.78  07-Nov-1999  miquels@cistron.nl
 #
@@ -52,6 +53,12 @@
   [ "$previous" = "" ] && previous=N
 
   export runlevel previous
+  
+  # keep track of last number we ran.
+  # we start jobs in parallel, only waiting between numbers
+  # e.g. S20athcool and S20xprint are started simultaneously
+  # but then we wait before starting S21xendomains
+  last_num=00
 
   # Is there an rc directory for this new runlevel?
   if [ -d /etc/rc$runlevel.d ]
@@ -64,14 +71,28 @@
 			# Check if the script is there.
 			[ ! -f $i ] && continue
 
+			# wait if the script number has increased
+			curr_num=`echo $i | sed 's/.*\/.\(..\).*/\1/'`
+			if [ $curr_num != $last_num ]; then
+				last_num=$curr_num
+				wait
+			fi
+
 			# Stop the service.
-			startup $i stop
+			startup $i stop &
 		done
 	fi
 	# Now run the START scripts for this runlevel.
 	for i in /etc/rc$runlevel.d/S*
 	do
 		[ ! -f $i ] && continue
+		
+		# wait if the script number has increased
+		curr_num=`echo $i | sed 's/.*\/.\(..\).*/\1/'`
+		if [ $curr_num != $last_num ]; then
+			last_num=$curr_num
+			wait
+		fi
 
 		if [ $previous != N ] && [ $previous != S ]
 		then
@@ -91,12 +112,13 @@
 		fi
 		case "$runlevel" in
 			0|6)
-				startup $i stop
+				startup $i stop &
 				;;
 			*)
-				startup $i start
+				startup $i start &
 				;;
 		esac
 	done
+	wait
   fi
 # eof /etc/init.d/rc
