diff options
-rwxr-xr-x | ezjail-admin | 23 | ||||
-rwxr-xr-x | ezjail.sh | 6 |
2 files changed, 25 insertions, 4 deletions
diff --git a/ezjail-admin b/ezjail-admin index be8e032..19aea96 100755 --- a/ezjail-admin +++ b/ezjail-admin | |||
@@ -29,6 +29,7 @@ ezjail_jailcfgs="${ezjail_etc}/ezjail" | |||
29 | : ${ezjail_devfs_ruleset="devfsrules_jail"} | 29 | : ${ezjail_devfs_ruleset="devfsrules_jail"} |
30 | : ${ezjail_procfs_enable="YES"} | 30 | : ${ezjail_procfs_enable="YES"} |
31 | : ${ezjail_fdescfs_enable="YES"} | 31 | : ${ezjail_fdescfs_enable="YES"} |
32 | : ${ezjail_exec_start="/bin/sh /etc/rc"} | ||
32 | 33 | ||
33 | : ${ezjail_use_zfs="NO"} | 34 | : ${ezjail_use_zfs="NO"} |
34 | : ${ezjail_jailzfs=""} | 35 | : ${ezjail_jailzfs=""} |
@@ -160,10 +161,11 @@ writejailinfo () { | |||
160 | echo export jail_${ezjail_safename}_hostname=\"${ezjail_hostname}\" | 161 | echo export jail_${ezjail_safename}_hostname=\"${ezjail_hostname}\" |
161 | echo export jail_${ezjail_safename}_ip=\"${ezjail_ips}\" | 162 | echo export jail_${ezjail_safename}_ip=\"${ezjail_ips}\" |
162 | echo export jail_${ezjail_safename}_rootdir=\"${ezjail_rootdir}\" | 163 | echo export jail_${ezjail_safename}_rootdir=\"${ezjail_rootdir}\" |
163 | echo export jail_${ezjail_safename}_exec=\"/bin/sh /etc/rc\" | 164 | echo export jail_${ezjail_safename}_exec_start=\"${ezjail_exec_start}\" |
165 | echo export jail_${ezjail_safename}_exec_stop=\"${ezjail_exec_stop}\" | ||
164 | echo export jail_${ezjail_safename}_mount_enable=\"${ezjail_mount_enable}\" | 166 | echo export jail_${ezjail_safename}_mount_enable=\"${ezjail_mount_enable}\" |
165 | echo export jail_${ezjail_safename}_devfs_enable=\"${ezjail_devfs_enable}\" | 167 | echo export jail_${ezjail_safename}_devfs_enable=\"${ezjail_devfs_enable}\" |
166 | echo export jail_${ezjail_safename}_devfs_ruleset=\"devfsrules_jail\" | 168 | echo export jail_${ezjail_safename}_devfs_ruleset=\"${ezjail_devfs_ruleset}\" |
167 | echo export jail_${ezjail_safename}_procfs_enable=\"${ezjail_procfs_enable}\" | 169 | echo export jail_${ezjail_safename}_procfs_enable=\"${ezjail_procfs_enable}\" |
168 | echo export jail_${ezjail_safename}_fdescfs_enable=\"${ezjail_fdescfs_enable}\" | 170 | echo export jail_${ezjail_safename}_fdescfs_enable=\"${ezjail_fdescfs_enable}\" |
169 | echo export jail_${ezjail_safename}_image=\"${ezjail_image}\" | 171 | echo export jail_${ezjail_safename}_image=\"${ezjail_image}\" |
@@ -184,7 +186,7 @@ fetchjailinfo () { | |||
184 | ezjail_name=$1 | 186 | ezjail_name=$1 |
185 | 187 | ||
186 | # Clean variables, prevent polution | 188 | # Clean variables, prevent polution |
187 | unset ezjail_config ezjail_running ezjail_hostname ezjail_rootdir ezjail_image ezjail_imagetype ezjail_imagedevice ezjail_devicelink ezjail_ips ezjail_id ezjail_attached ezjail_device ezjail_device_geom | 189 | unset ezjail_config ezjail_running ezjail_hostname ezjail_rootdir ezjail_image ezjail_imagetype ezjail_imagedevice ezjail_devicelink ezjail_ips ezjail_id ezjail_attached ezjail_device ezjail_device_geom ezjail_exec_start ezjail_exec_stop ezjail_mount_enable ezjail_devfs_enable ezjail_devfs_ruleset ezjail_procfs_enable ezjail_fdescfs_enable |
188 | 190 | ||
189 | ezjail_safename=`echo -n "${ezjail_name}" | tr -c '[:alnum:]' _` | 191 | ezjail_safename=`echo -n "${ezjail_name}" | tr -c '[:alnum:]' _` |
190 | 192 | ||
@@ -198,8 +200,21 @@ fetchjailinfo () { | |||
198 | 200 | ||
199 | . "${ezjail_config}" | 201 | . "${ezjail_config}" |
200 | eval ezjail_hostname=\"\$jail_${ezjail_safename}_hostname\" | 202 | eval ezjail_hostname=\"\$jail_${ezjail_safename}_hostname\" |
201 | eval ezjail_rootdir=\"\$jail_${ezjail_safename}_rootdir\" | ||
202 | eval ezjail_ips=\"\$jail_${ezjail_safename}_ip\" | 203 | eval ezjail_ips=\"\$jail_${ezjail_safename}_ip\" |
204 | eval ezjail_rootdir=\"\$jail_${ezjail_safename}_rootdir\" | ||
205 | |||
206 | eval ezjail_exec_start=\"\$jail_${ezjail_safename}_exec_start\" | ||
207 | eval ezjail_exec_stop=\"\$jail_${ezjail_safename}_exec_stop\" | ||
208 | # fix backward compatibility issue | ||
209 | eval ezjail_exec=\"\$jail_${ezjail_safename}_exec\" | ||
210 | [ "${ezjail_exec}" -a -z "${ezjail_exec_start}" ] ezjail_exec_start=${ezjail_exec} | ||
211 | |||
212 | eval ezjail_mount_enable=\"\$jail_${ezjail_safename}_mount_enable\" | ||
213 | eval ezjail_devfs_enable=\"\$jail_${ezjail_safename}_devfs_enable\" | ||
214 | eval ezjail_devfs_ruleset=\"\$jail_${ezjail_safename}_devfs_ruleset\" | ||
215 | eval ezjail_procfs_enable=\"\$jail_${ezjail_safename}_procfs_enable\" | ||
216 | eval ezjail_fdescfs_enable=\"\$jail_${ezjail_safename}_fdescfs_enable\" | ||
217 | |||
203 | eval ezjail_image=\"\$jail_${ezjail_safename}_image\" | 218 | eval ezjail_image=\"\$jail_${ezjail_safename}_image\" |
204 | eval ezjail_imagetype=\"\$jail_${ezjail_safename}_imagetype\" | 219 | eval ezjail_imagetype=\"\$jail_${ezjail_safename}_imagetype\" |
205 | eval ezjail_attachparams=\"\$jail_${ezjail_safename}_attachparams\" | 220 | eval ezjail_attachparams=\"\$jail_${ezjail_safename}_attachparams\" |
@@ -77,6 +77,12 @@ do_cmd() | |||
77 | eval ezjail_zfs_datasets=\"\$jail_${ezjail}_zfs_datasets\" | 77 | eval ezjail_zfs_datasets=\"\$jail_${ezjail}_zfs_datasets\" |
78 | eval ezjail_cpuset=\"\$jail_${ezjail}_cpuset\" | 78 | eval ezjail_cpuset=\"\$jail_${ezjail}_cpuset\" |
79 | 79 | ||
80 | # Fix backward compatibility issue | ||
81 | eval ezjail_exec_start=\"\$jail_${ezjail}_exec_start\" | ||
82 | eval ezjail_exec=\"\$jail_${ezjail}_exec\" | ||
83 | eval jail_${ezjail}_exec_start=${ezjail_exec_start:-${ezjail_exec}} | ||
84 | eval unset jail_${ezjail}_exec | ||
85 | |||
80 | # Do we still have a root to run in? | 86 | # Do we still have a root to run in? |
81 | [ ! -d "${ezjail_rootdir}" ] && echo " Warning: root directory ${ezjail_rootdir} of ${ezjail} does not exist." && continue | 87 | [ ! -d "${ezjail_rootdir}" ] && echo " Warning: root directory ${ezjail_rootdir} of ${ezjail} does not exist." && continue |
82 | 88 | ||