Skip site navigation (1)Skip section navigation (2)
Date:      Wed, 14 Jun 2006 12:10:25 +0200
From:      "Raphael H. Becker" <rabe@p-i-n.com>
To:        freebsd-current@freebsd.org
Subject:   jail_<name>_conf in /etc/rc.conf
Message-ID:  <20060614121025.D47362@p-i-n.com>

next in thread | raw e-mail | index | archive | help

Hi *,

having a jail-server and maintaining lots of jails may cause headache,
when editing /etc/rc.conf. 

My idea is to define per-jail.conf files outside /etc/rc.conf.


# ---- /etc/rc.conf ----
# Jail-defaults and stuff

jail_enable="YES"
jail_list="foo0 foo1 foo2 foo3 bar0 bar1 bar2 "
jail_set_hostname_allow="NO"

# per-Jail conf:

jail_foo0_conf=/etc/jails/foo0.conf
jail_foo1_conf=/etc/jails/foo1.conf
jail_foo2_conf=/etc/jails/foo2.conf
jail_foo3_conf=/etc/jails/foo3.conf
[...]


... and in /etc/jails/foo0.conf

jail_rootdir="/data/jails/foo0/"       
jail_hostname="foo0.example.org"     
jail_ip="192.168.0.10"                 
jail_interface="fxp1"                      
jail_exec_start="/bin/sh /etc/rc"      
jail_exec_afterstart0="/bin/sh command"
...

This would make using conf-templates much easier and you don't 
need to do evil "script-magic" on /etc/rc.conf.

This may fit into the latest /etc/rc.d/jail script: just look for
$jail_foo0_conf first and use this .conf (if found).


Any alternative solution getting something like this running?

Regards
Raphael Becker



Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?20060614121025.D47362>