[Pkg-sysvinit-commits] r1310 - in sysvinit/trunk/debian: . sysv-rc/etc/init.d
kelmo-guest at alioth.debian.org
kelmo-guest at alioth.debian.org
Mon Feb 2 12:20:18 UTC 2009
Author: kelmo-guest
Date: 2009-02-02 12:20:18 +0000 (Mon, 02 Feb 2009)
New Revision: 1310
Modified:
sysvinit/trunk/debian/changelog
sysvinit/trunk/debian/sysv-rc/etc/init.d/rc
Log:
* Enable CONCURRENCY=makefile mode in debian/sysv-rc/etc/init.d/rc.
This mode uses startpar and the /etc/init.d/.depend.* makefile-like
information created by insserv to calculate boot script execution
order. The splash API is not supported in this mode of boot. This
mode of boot is considered very experimental at this time.
* Allow startpar using concurrency modes to operate in runlevel S, now
that startpar can manage to work properly in absence of /dev/pts.
Modified: sysvinit/trunk/debian/changelog
===================================================================
--- sysvinit/trunk/debian/changelog 2009-02-02 12:11:58 UTC (rev 1309)
+++ sysvinit/trunk/debian/changelog 2009-02-02 12:20:18 UTC (rev 1310)
@@ -8,8 +8,15 @@
compatibility patch (sent upstream). Also workaround /dev/pts not
being mounted early in runlevel S by having startpar use an own
version of getpt(2) system call. Closes: #457896, #484883
+ * Enable CONCURRENCY=makefile mode in debian/sysv-rc/etc/init.d/rc.
+ This mode uses startpar and the /etc/init.d/.depend.* makefile-like
+ information created by insserv to calculate boot script execution
+ order. The splash API is not supported in this mode of boot. This
+ mode of boot is considered very experimental at this time.
+ * Allow startpar using concurrency modes to operate in runlevel S, now
+ that startpar can manage to work properly in absence of /dev/pts.
- -- Kel Modderman <kel at otaku42.de> Mon, 02 Feb 2009 22:10:24 +1000
+ -- Kel Modderman <kel at otaku42.de> Mon, 02 Feb 2009 22:19:01 +1000
sysvinit (2.86.ds1-61) unstable; urgency=low
Modified: sysvinit/trunk/debian/sysv-rc/etc/init.d/rc
===================================================================
--- sysvinit/trunk/debian/sysv-rc/etc/init.d/rc 2009-02-02 12:11:58 UTC (rev 1309)
+++ sysvinit/trunk/debian/sysv-rc/etc/init.d/rc 2009-02-02 12:20:18 UTC (rev 1310)
@@ -78,6 +78,8 @@
. /lib/lsb/init-functions
else
log_action_msg() { echo $@; }
+ log_failure_msg() { echo $@; }
+ log_warning_msg() { echo $@; }
fi
#
@@ -103,18 +105,11 @@
# Check if we are able to use make like booting. It require the
# insserv package to be enabled.
#
-if [ startpar = "$CONCURRENCY" ] ; then
+if [ startpar = "$CONCURRENCY" ] || [ makefile = "$CONCURRENCY" ] ; then
test -s /etc/init.d/.depend.boot || CONCURRENCY="none"
test -s /etc/init.d/.depend.start || CONCURRENCY="none"
test -s /etc/init.d/.depend.stop || CONCURRENCY="none"
startpar -v > /dev/null 2>&1 || CONCURRENCY="none"
-
- # startpar do not work properly at the start of rcS.d/. Avoid it.
- # See #457896 for details.
-
- if [ S = "$runlevel" ] ; then
- CONCURRENCY=none
- fi
fi
#
@@ -198,6 +193,25 @@
startup_progress
}
;;
+ makefile)
+ log_action_msg "Using makefile-style concurrent boot in runlevel $runlevel"
+ # The splash API is not handled with this CONCURRENCY mode
+ startup() {
+ eval "$(startpar -p 4 -t 20 -T 3 -M $1 -P $previous -R $runlevel)"
+
+ if [ -n "$failed_service" ]
+ then
+ log_failure_msg "startpar: service(s) returned failure: $failed_service"
+ fi
+
+ if [ -n "$skipped_service" ]
+ then
+ log_warning_msg "startpar: service(s) skipped: $skipped_service"
+ fi
+
+ unset failed_service skipped_service
+ }
+ ;;
none|*)
startup() {
action=$1
@@ -288,8 +302,11 @@
done
step=0
+ if [ makefile = "$CONCURRENCY" ]
+ then
+ [ "$previous" != N ] && startup stop
# First, run the KILL scripts.
- if [ "$previous" != N ]
+ elif [ "$previous" != N ]
then
# Run all scripts with the same level in parallel
CURLEVEL=""
@@ -333,60 +350,70 @@
done
fi
- # Now run the START scripts for this runlevel.
- # Run all scripts with the same level in parallel
- CURLEVEL=""
- for s in /etc/rc$runlevel.d/S*
- do
- # Extract order value from symlink
- level=${s#/etc/rc$runlevel.d/S}
- level=${level%%[a-z]*}
- if [ "$level" = "$CURLEVEL" ]
+ if [ makefile = "$CONCURRENCY" ]
+ then
+ if [ S = "$runlevel" ]
then
- continue
+ startup boot
+ else
+ startup $ACTION
fi
- CURLEVEL=$level
- SCRIPTS=""
- for i in /etc/rc$runlevel.d/S$level*
+ else
+ # Now run the START scripts for this runlevel.
+ # Run all scripts with the same level in parallel
+ CURLEVEL=""
+ for s in /etc/rc$runlevel.d/S*
do
- [ ! -f $i ] && continue
+ # Extract order value from symlink
+ level=${s#/etc/rc$runlevel.d/S}
+ level=${level%%[a-z]*}
+ if [ "$level" = "$CURLEVEL" ]
+ then
+ continue
+ fi
+ CURLEVEL=$level
+ SCRIPTS=""
+ for i in /etc/rc$runlevel.d/S$level*
+ do
+ [ ! -f $i ] && continue
- suffix=${i#/etc/rc$runlevel.d/S[0-9][0-9]}
- if [ "$previous" != N ]
- then
- #
- # Find start script in previous runlevel and
- # stop script in this runlevel.
- #
- stop=/etc/rc$runlevel.d/K[0-9][0-9]$suffix
- previous_start=/etc/rc$previous.d/S[0-9][0-9]$suffix
- #
- # If there is a start script in the previous level
- # and _no_ stop script in this level, we don't
- # have to re-start the service.
- #
- if [ start = "$ACTION" ] ; then
- [ -f $previous_start ] && [ ! -f $stop ] && continue
- else
- # Workaround for the special
- # handling of runlevels 0 and 6.
- previous_stop=/etc/rc$previous.d/K[0-9][0-9]$suffix
- #
- # If there is a stop script in the previous level
- # and _no_ start script there, we don't
- # have to re-stop the service.
- #
- [ -f $previous_stop ] && [ ! -f $previous_start ] && continue
+ suffix=${i#/etc/rc$runlevel.d/S[0-9][0-9]}
+ if [ "$previous" != N ]
+ then
+ #
+ # Find start script in previous runlevel and
+ # stop script in this runlevel.
+ #
+ stop=/etc/rc$runlevel.d/K[0-9][0-9]$suffix
+ previous_start=/etc/rc$previous.d/S[0-9][0-9]$suffix
+ #
+ # If there is a start script in the previous level
+ # and _no_ stop script in this level, we don't
+ # have to re-start the service.
+ #
+ if [ start = "$ACTION" ] ; then
+ [ -f $previous_start ] && [ ! -f $stop ] && continue
+ else
+ # Workaround for the special
+ # handling of runlevels 0 and 6.
+ previous_stop=/etc/rc$previous.d/K[0-9][0-9]$suffix
+ #
+ # If there is a stop script in the previous level
+ # and _no_ start script there, we don't
+ # have to re-stop the service.
+ #
+ [ -f $previous_stop ] && [ ! -f $previous_start ] && continue
+ fi
+
fi
-
- fi
- SCRIPTS="$SCRIPTS $i"
- if is_splash_stop_scripts "$suffix" ; then
- splash_stop || true
- fi
+ SCRIPTS="$SCRIPTS $i"
+ if is_splash_stop_scripts "$suffix" ; then
+ splash_stop || true
+ fi
+ done
+ startup $ACTION $SCRIPTS
done
- startup $ACTION $SCRIPTS
- done
+ fi
fi
if [ S = "$runlevel" ]
More information about the Pkg-sysvinit-commits
mailing list