Spil Oss
2010-Oct-24 09:04 UTC
Name and JID support in /etc/rc.d/jail and jail(8) documentation
Hi All, Created a small patch for 8.1 to add name support to /etc/rc.d/jail. This doesn't upgrade /etc/rc.d/jail to the overhauled invocation of 8.0 but merely adds the ability to set a jail's name on start which was added in FreeBSD 7.2 (May 2009). Could this patch be considered to be applied to stable? # diff -ruN /etc/rc.d/jail-8.1 /etc/rc.d/jail --- /etc/rc.d/jail-8.1 2010-07-21 07:19:46.000000000 +0200 +++ /etc/rc.d/jail 2010-10-24 10:55:14.000000000 +0200 @@ -38,6 +38,7 @@ _fdescdir="${_devdir}/fd" _procdir="${_rootdir}/proc" eval _hostname=\"\$jail_${_j}_hostname\" + eval _name=\"\$jail_${_j}_name\" eval _ip=\"\$jail_${_j}_ip\" eval _interface=\"\${jail_${_j}_interface:-${jail_interface}}\" eval _exec=\"\$jail_${_j}_exec\" @@ -122,6 +123,7 @@ debug "$_j procfs enable: $_procfs" debug "$_j mount enable: $_mount" debug "$_j hostname: $_hostname" + debug "$_j name: $_name" debug "$_j ip: $_ip" jail_show_addresses ${_j} debug "$_j interface: $_interface" @@ -635,6 +637,10 @@ i=$((i + 1)) done + if [ -n "${_name}" ] ; then + _flags="${_flags} -n ${_name}" + fi + eval ${_setfib} jail ${_flags} -i ${_rootdir} ${_hostname} \ \"${_addrl}\" ${_exec_start} > ${_tmp_jail} 2>&1 Kind regards, Spil. On Sun, Oct 24, 2010 at 10:52 AM, Spil Oss <spil.oss@gmail.com> wrote:> Hi All, > > When starting a jail you can, as of 8.0 if I'm not mistaken, set the > JID and name for a jail. This change doesn't seem to have been > incorporated into the /etc/rc.d/jail script? Looking at > http://wiki.polymorf.fr/index.php/Howto:FreeBSD_jail_vnet it wouldn't > be a huge change to add name support. The other additions in that > script look a lot more intrusive. Are there any plans to merge this > patch into the jail rc-script or is this "v2" style of jail invocation > still considered to be experimental? As of 8.1 is seems to no longer > be considered experimental looking at the release notes. > > The jail(8) documentation (mine lists FreeBSD 8.1 January 17, 2010) > seems to be missing documentation on the vnet command (due to the > experimental status)? > > Kind regards, > > Spil. >
Spil Oss
2010-Oct-24 09:16 UTC
Name and JID support in /etc/rc.d/jail and jail(8) documentation
Hi All, When starting a jail you can, as of 8.0 if I'm not mistaken, set the JID and name for a jail. This change doesn't seem to have been incorporated into the /etc/rc.d/jail script? Looking at http://wiki.polymorf.fr/index.php/Howto:FreeBSD_jail_vnet it wouldn't be a huge change to add name support. The other additions in that script look a lot more intrusive. Are there any plans to merge this patch into the jail rc-script or is this "v2" style of jail invocation still considered to be experimental? As of 8.1 is seems to no longer be considered experimental looking at the release notes. The jail(8) documentation (mine lists FreeBSD 8.1 January 17, 2010) seems to be missing documentation on the vnet command (due to the experimental status)? Kind regards, Spil.