svn commit: r204759 - in head: etc/defaults etc/rc.d share/man/man5

Doug Barton dougb at FreeBSD.org
Fri Mar 5 21:18:03 UTC 2010


On Fri, 5 Mar 2010, Alexander Leidinger wrote:

> Author: netchild
> Date: Fri Mar  5 14:34:33 2010
> New Revision: 204759
> URL: http://svn.freebsd.org/changeset/base/204759

I've got no comments on the jail-related stuff given that my knowledge of 
jails is almost non-existent. However I wish you had run your diff past 
freebsd-rc@ since if you had I (or someone else) could have let you know 
that the attached patch is a much cleaner way of implementing the bit 
about conditionalizing "parallel" execution (which, to the extent I 
understand the problem I agree with your solution of only doing it at when 
starting, FWIW).

In general we try to avoid having any code in rc.d scripts run 
unconditionally. In this case it's harmless (although every cpu cycle 
counts) but in other cases it can cause problems, which is why as a 
general rule it's safer to avoid it altogether.


hth,

Doug
-------------- next part --------------
Index: jail
===================================================================
--- jail	(revision 204770)
+++ jail	(working copy)
@@ -18,6 +18,8 @@
 
 name="jail"
 rcvar=`set_rcvar`
+
+start_precmd="jail_prestart"
 start_cmd="jail_start"
 stop_cmd="jail_stop"
 
@@ -545,6 +547,13 @@
 	done
 }
 
+jail_prestart()
+{
+	if checkyesno jail_parallel_start; then
+		command_args='&'
+	fi
+}
+
 jail_start()
 {
 	echo -n 'Configuring jails:'
@@ -730,18 +739,4 @@
 	jail_list="$*"
 fi
 
-# Only allow the parallel start of jails, other commands are not
-# safe to execute in parallel.
-case "${cmd}" in
-*start)
-	;;
-*)
-	jail_parallel_start=NO
-esac
-
-if checkyesno jail_parallel_start; then
-	run_rc_command "${cmd}" &
-else
-	run_rc_command "${cmd}"
-fi
-
+run_rc_command "${cmd}"


More information about the svn-src-all mailing list