How could a jail learn which is its parent host?
Panagiotis Christias
christias at gmail.com
Tue Mar 2 23:18:52 UTC 2010
On Tue, Mar 2, 2010 at 3:55 PM, Alexey V. Degtyarev
<alexey at renatasystems.org> wrote:
>
> On 10:37 Tue 02 Mar, Panagiotis Christias wrote:
>
>> I am looking for a simple way so each jail could know at any time in
>> which (physical) server is hosted. Any suggestions?
>
> You may push a kernel environment on physical server so it will be
> available from within jail. To achieve it, on the mainhost (physical
> server) add to /boot/loader.conf:
>
> x.mainhost="physical.example.com"
>
> after reboot the mainhost server, you can use x.mainhost env from within
> jail (and mainhost as well):
>
> [root at jail1 ~]# kenv x.mainhost
> physical.example.com
>
> Check kenv(1) and loader.conf(5) for details.
Thanks all for your suggestions. Kenv looks like the clearest way to
go, although jail_exec_prestart and jail_exec_afterstart can be really
useful too.
Regards,
Panagiotis
More information about the freebsd-jail
mailing list