summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
-rw-r--r--etc/defaults/rc.conf1
-rwxr-xr-xetc/rc.d/jail20
-rw-r--r--share/man/man5/rc.conf.57
3 files changed, 25 insertions, 3 deletions
diff --git a/etc/defaults/rc.conf b/etc/defaults/rc.conf
index 35b3a7b..dfdf08f 100644
--- a/etc/defaults/rc.conf
+++ b/etc/defaults/rc.conf
@@ -637,6 +637,7 @@ mixer_enable="YES" # Run the sound mixer.
### Jail Configuration #######################################
##############################################################
jail_enable="NO" # Set to NO to disable starting of any jails
+jail_parallel_start="NO" # Start jails in the background
jail_list="" # Space separated list of names of jails
jail_set_hostname_allow="YES" # Allow root user in a jail to change its hostname
jail_socket_unixiproute_only="YES" # Route only TCP/IP within a jail
diff --git a/etc/rc.d/jail b/etc/rc.d/jail
index 084acb7..76342cf 100755
--- a/etc/rc.d/jail
+++ b/etc/rc.d/jail
@@ -636,7 +636,8 @@ jail_start()
done
eval ${_setfib} jail ${_flags} -i ${_rootdir} ${_hostname} \
- \"${_addrl}\" ${_exec_start} > ${_tmp_jail} 2>&1
+ \"${_addrl}\" ${_exec_start} > ${_tmp_jail} 2>&1 \
+ </dev/null
if [ "$?" -eq 0 ] ; then
_jail_id=$(head -1 ${_tmp_jail})
@@ -728,4 +729,19 @@ fi
if [ -n "$*" ]; then
jail_list="$*"
fi
-run_rc_command "${cmd}" &
+
+# 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
+
diff --git a/share/man/man5/rc.conf.5 b/share/man/man5/rc.conf.5
index 96f64d3..ec3f292 100644
--- a/share/man/man5/rc.conf.5
+++ b/share/man/man5/rc.conf.5
@@ -24,7 +24,7 @@
.\"
.\" $FreeBSD$
.\"
-.Dd February 12, 2010
+.Dd March 05, 2010
.Dt RC.CONF 5
.Os
.Sh NAME
@@ -3497,6 +3497,11 @@ indicates that the highest frequency (less power savings) should be used.
If set to
.Dq Li NO ,
any configured jails will not be started.
+.It jail_parallel_start
+.Pq Vt bool
+If set to
+.Dq Li YES
+all configured jails will be started in the background (= in parallel).
.It Va jail_list
.Pq Vt str
A space separated list of names for jails.
OpenPOWER on IntegriCloud