Index: etc/defaults/rc.conf =================================================================== RCS file: /home/cvs/FreeBSD/src/etc/defaults/rc.conf,v retrieving revision 1.202 diff -u -r1.202 rc.conf --- etc/defaults/rc.conf 23 Mar 2004 23:22:34 -0000 1.202 +++ etc/defaults/rc.conf 26 Mar 2004 21:31:47 -0000 @@ -473,6 +473,8 @@ #jail_example_rootdir="/usr/jail/default" # Jail's root directory #jail_example_hostname="default.domain.com" # Jail's hostname #jail_example_ip="192.168.0.10" # Jail's IP number +#jail_example_pre_exec="" # command to execute just + # before jailing. #jail_example_exec="/bin/sh /etc/rc" # command to execute in jail #jail_example_devfs_enable="NO" # mount devfs in the jail #jail_example_fdescfs_enable="NO" # mount fdescfs in the jail Index: etc/rc.d/jail =================================================================== RCS file: /home/cvs/FreeBSD/src/etc/rc.d/jail,v retrieving revision 1.14 diff -u -r1.14 jail --- etc/rc.d/jail 8 Mar 2004 12:25:05 -0000 1.14 +++ etc/rc.d/jail 26 Mar 2004 22:44:21 -0000 @@ -33,6 +33,7 @@ jail_procdir="${jail_rootdir}/proc" eval jail_hostname=\"\$jail_${_j}_hostname\" eval jail_ip=\"\$jail_${_j}_ip\" + eval jail_pre_exec=\"\$jail_${_j}_pre_exec\" eval jail_exec=\"\$jail_${_j}_exec\" [ -z "${jail_exec}" ] && jail_exec="/bin/sh /etc/rc" @@ -155,6 +156,7 @@ mount -t procfs proc "${jail_procdir}" fi fi + [ -n "${jail_pre_exec}" ] && ${jail_pre_exec} _tmp_jail=/tmp/jail.$$ jail -i ${jail_rootdir} ${jail_hostname} \ ${jail_ip} ${jail_exec} > ${_tmp_jail} 2>&1