Attaching the ZFS-dataset and configuring the CPUset didn't work when doing "start" without explicit jailnames. e.g. this happened during normal boot.
This commit is contained in:
parent
df3a3ee133
commit
5ad647ec21
26
ezjail.sh
26
ezjail.sh
@ -74,8 +74,6 @@ do_cmd()
|
|||||||
eval ezjail_attachparams=\"\$jail_${ezjail}_attachparams\"
|
eval ezjail_attachparams=\"\$jail_${ezjail}_attachparams\"
|
||||||
eval ezjail_attachblocking=\"\$jail_${ezjail}_attachblocking\"
|
eval ezjail_attachblocking=\"\$jail_${ezjail}_attachblocking\"
|
||||||
eval ezjail_forceblocking=\"\$jail_${ezjail}_forceblocking\"
|
eval ezjail_forceblocking=\"\$jail_${ezjail}_forceblocking\"
|
||||||
eval ezjail_zfs_datasets=\"\$jail_${ezjail}_zfs_datasets\"
|
|
||||||
eval ezjail_cpuset=\"\$jail_${ezjail}_cpuset\"
|
|
||||||
|
|
||||||
# Fix backward compatibility issue
|
# Fix backward compatibility issue
|
||||||
eval ezjail_exec_start=\"\$jail_${ezjail}_exec_start\"
|
eval ezjail_exec_start=\"\$jail_${ezjail}_exec_start\"
|
||||||
@ -105,18 +103,24 @@ do_cmd()
|
|||||||
# Pass control to jail script which does the actual work
|
# Pass control to jail script which does the actual work
|
||||||
[ "${ezjail_pass}" ] && sh /etc/rc.d/jail one${action%crypto} ${ezjail_pass}
|
[ "${ezjail_pass}" ] && sh /etc/rc.d/jail one${action%crypto} ${ezjail_pass}
|
||||||
|
|
||||||
|
# Configure settings that need to be done after the jail has been started
|
||||||
if [ "${action}" = "start" ]; then
|
if [ "${action}" = "start" ]; then
|
||||||
ezjail_safename=`echo -n "${ezjail}" | tr -c '[:alnum:]' _`
|
for ezjail in ${ezjail_list}; do
|
||||||
# Get the JID of the jail
|
ezjail_safename=`echo -n "${ezjail}" | tr -c '[:alnum:]' _`
|
||||||
[ -f "/var/run/jail_${ezjail_safename}.id" ] && ezjail_id=`cat /var/run/jail_${ezjail_safename}.id` || return
|
# Get the JID of the jail
|
||||||
|
[ -f "/var/run/jail_${ezjail_safename}.id" ] && ezjail_id=`cat /var/run/jail_${ezjail_safename}.id` || return
|
||||||
|
|
||||||
# Attach ZFS-datasets to the jail
|
eval ezjail_zfs_datasets=\"\$jail_${ezjail_safename}_zfs_datasets\"
|
||||||
for zfs in ${ezjail_zfs_datasets}; do
|
eval ezjail_cpuset=\"\$jail_${ezjail_safename}_cpuset\"
|
||||||
/sbin/zfs jail ${ezjail_id} ${zfs} || echo -n "Error: ${zfs} could not be configured"
|
|
||||||
|
# Attach ZFS-datasets to the jail
|
||||||
|
for zfs in ${ezjail_zfs_datasets}; do
|
||||||
|
/sbin/zfs jail ${ezjail_id} ${zfs} || echo -n "Error: ${zfs} could not be configured"
|
||||||
|
done
|
||||||
|
|
||||||
|
# Configure processor sets for the jail via cpuset(1)
|
||||||
|
[ -z "${ezjail_cpuset}" ] || /usr/bin/cpuset -l ${ezjail_cpuset} -j ${ezjail_id} || echo -n "Error: The defined cpuset is malformed"
|
||||||
done
|
done
|
||||||
|
|
||||||
# Configure processor sets for the jail via cpuset(1)
|
|
||||||
[ -z "${ezjail_cpuset}" ] || /usr/bin/cpuset -l ${ezjail_cpuset} -j ${ezjail_id} || echo -n "Error: The defined cpuset is malformed"
|
|
||||||
fi
|
fi
|
||||||
|
|
||||||
# Can only detach after unmounting (from fstab.JAILNAME in /etc/rc.d/jail)
|
# Can only detach after unmounting (from fstab.JAILNAME in /etc/rc.d/jail)
|
||||||
|
Loading…
x
Reference in New Issue
Block a user