summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rwxr-xr-xezjail.sh26
1 files changed, 15 insertions, 11 deletions
diff --git a/ezjail.sh b/ezjail.sh
index b12ed12..a9716e3 100755
--- a/ezjail.sh
+++ b/ezjail.sh
@@ -74,8 +74,6 @@ do_cmd()
74 eval ezjail_attachparams=\"\$jail_${ezjail}_attachparams\" 74 eval ezjail_attachparams=\"\$jail_${ezjail}_attachparams\"
75 eval ezjail_attachblocking=\"\$jail_${ezjail}_attachblocking\" 75 eval ezjail_attachblocking=\"\$jail_${ezjail}_attachblocking\"
76 eval ezjail_forceblocking=\"\$jail_${ezjail}_forceblocking\" 76 eval ezjail_forceblocking=\"\$jail_${ezjail}_forceblocking\"
77 eval ezjail_zfs_datasets=\"\$jail_${ezjail}_zfs_datasets\"
78 eval ezjail_cpuset=\"\$jail_${ezjail}_cpuset\"
79 77
80 # Fix backward compatibility issue 78 # Fix backward compatibility issue
81 eval ezjail_exec_start=\"\$jail_${ezjail}_exec_start\" 79 eval ezjail_exec_start=\"\$jail_${ezjail}_exec_start\"
@@ -105,18 +103,24 @@ do_cmd()
105 # Pass control to jail script which does the actual work 103 # Pass control to jail script which does the actual work
106 [ "${ezjail_pass}" ] && sh /etc/rc.d/jail one${action%crypto} ${ezjail_pass} 104 [ "${ezjail_pass}" ] && sh /etc/rc.d/jail one${action%crypto} ${ezjail_pass}
107 105
106 # Configure settings that need to be done after the jail has been started
108 if [ "${action}" = "start" ]; then 107 if [ "${action}" = "start" ]; then
109 ezjail_safename=`echo -n "${ezjail}" | tr -c '[:alnum:]' _` 108 for ezjail in ${ezjail_list}; do
110 # Get the JID of the jail 109 ezjail_safename=`echo -n "${ezjail}" | tr -c '[:alnum:]' _`
111 [ -f "/var/run/jail_${ezjail_safename}.id" ] && ezjail_id=`cat /var/run/jail_${ezjail_safename}.id` || return 110 # Get the JID of the jail
111 [ -f "/var/run/jail_${ezjail_safename}.id" ] && ezjail_id=`cat /var/run/jail_${ezjail_safename}.id` || return
112 112
113 # Attach ZFS-datasets to the jail 113 eval ezjail_zfs_datasets=\"\$jail_${ezjail_safename}_zfs_datasets\"
114 for zfs in ${ezjail_zfs_datasets}; do 114 eval ezjail_cpuset=\"\$jail_${ezjail_safename}_cpuset\"
115 /sbin/zfs jail ${ezjail_id} ${zfs} || echo -n "Error: ${zfs} could not be configured" 115
116 done 116 # Attach ZFS-datasets to the jail
117 for zfs in ${ezjail_zfs_datasets}; do
118 /sbin/zfs jail ${ezjail_id} ${zfs} || echo -n "Error: ${zfs} could not be configured"
119 done
117 120
118 # Configure processor sets for the jail via cpuset(1) 121 # Configure processor sets for the jail via cpuset(1)
119 [ -z "${ezjail_cpuset}" ] || /usr/bin/cpuset -l ${ezjail_cpuset} -j ${ezjail_id} || echo -n "Error: The defined cpuset is malformed" 122 [ -z "${ezjail_cpuset}" ] || /usr/bin/cpuset -l ${ezjail_cpuset} -j ${ezjail_id} || echo -n "Error: The defined cpuset is malformed"
123 done
120 fi 124 fi
121 125
122 # Can only detach after unmounting (from fstab.JAILNAME in /etc/rc.d/jail) 126 # Can only detach after unmounting (from fstab.JAILNAME in /etc/rc.d/jail)