[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: [ezjail] Name support in ezjail



This should do the trick!

# 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

But that's only adding support for jail_name_example=example which is
available as of 7.2, it doesn't fix the overhaul of jail in 8.0 and
later.

Kind regards,

Spil.

On Sat, Oct 23, 2010 at 9:55 PM, Spil Oss <spil.oss AT gmail DOT com> wrote:
> This page describes adding name support to /etc/rc.d (and a lot mpre)
> http://wiki.polymorf.fr/index.php/Howto:FreeBSD_jail_vnet
>
> Is any work underway to support jail names in /etc/rc.d that you know of?
>
> Could extract the name parts from that page and submit it as a patch
> to FreeBSD I guess....
>
> On Sat, Oct 23, 2010 at 7:45 PM, Dirk Engling <erdgeist AT erdgeist DOT org> wrote:
>> On 23.10.10 17:03, Spil Oss wrote:
>>
>>> Looking at the rc file for ezjail (and /etc/rc.d/jail) I don't see
>>> that it's added in the call to jail with -n <name> . Is it not
>>> supported? If not supported, are there any plans to add name support
>>> to ezjail?
>>
>> The problem here is that ezjail does not utilise jail directly but
>> /etc/rc.d/jail which has no concept of jail names. If it would, I would
>> of course immediately use it.
>>
>> Regards,
>>
>>  erdgeist
>>
>