Skip site navigation (1)Skip section navigation (2)
Date:      Fri, 5 Mar 2010 21:18:00 +0000 (UTC)
From:      Doug Barton <dougb@FreeBSD.org>
To:        Alexander Leidinger <netchild@FreeBSD.org>
Cc:        svn-src-head@freebsd.org, svn-src-all@freebsd.org, src-committers@freebsd.org
Subject:   Re: svn commit: r204759 - in head: etc/defaults etc/rc.d share/man/man5
Message-ID:  <alpine.BSF.2.00.1003052113350.98935@serrsnyy.serrofq.bet>
In-Reply-To: <201003051434.o25EYXBR024375@svn.freebsd.org>
References:  <201003051434.o25EYXBR024375@svn.freebsd.org>

next in thread | previous in thread | raw e-mail | index | archive | help

[-- Attachment #1 --]
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
[-- Attachment #2 --]
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}"

Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?alpine.BSF.2.00.1003052113350.98935>