Skip site navigation (1)Skip section navigation (2)
Date:      Mon, 30 Jul 2007 22:16:04 +0200
From:      Jeremie Le Hen <jeremie@le-hen.org>
To:        John Baldwin <jhb@freebsd.org>
Cc:        freebsd-current@freebsd.org
Subject:   Re: RFC for wider rc.conf.d/ for jails
Message-ID:  <20070730201604.GA11947@obiwan.tataz.chchile.org>
In-Reply-To: <200707160917.51941.jhb@freebsd.org>
References:  <20070617225824.GA88370@obiwan.tataz.chchile.org> <200707160917.51941.jhb@freebsd.org>

next in thread | previous in thread | raw e-mail | index | archive | help
Hi,

On Mon, Jul 16, 2007 at 09:17:51AM -0400, John Baldwin wrote:
> On Sunday 17 June 2007 06:58:25 pm Jeremie Le Hen wrote:
> > Hi,
> > 
> > It is only possible to use /etc/rc.conf.d/${name}, where ${name} is the
> > command name in rc(8) scripts.  For instance, one can use use
> > /etc/rc.conf.d/named thanks to /etc/rc.d/named.  However it is not
> > possible to use /etc/rc.conf.d/foo because command "foo" is not provided
> > by any rc.d script.
> > 
> > I would like to extend this behaviour for /etc/rc.d/jail in order to
> > be able to have one file per jail.  It would require to either modify
> > rc.subr or hack up etc/rc.d/jail to include some additional files.
> > I am thinking about the following layout:
> > 
> > % # cat rc.conf.d/jail
> > % jail_list="mail www"
> > % # cat rc.conf.d/jail.mail
> > % [...]	    # "mail" jail configuration variables.
> > % # cat rc.conf.d/jail.www
> > % [...]	    # "www" jail configuration variables.
> 
> Maybe instead /etc/jail/mail, etc.?  I'd rather not overload /etc/rc.conf.d 
> since it already has a well-defined meaning.

Sorry for the late reply.  I've slightly modified etc/rc.d/jail to
handle etc/jail/<name>.

For instance, instead of the following in rc.conf(5):
% jail_example_rootdir="/usr/jail/example"
% jail_example_hostname="jail.example.org"
% jail_example_ip="192.168.1.123"
% jail_example_exec="/bin/sh /etc/rc"
% jail_example_devfs_enable="YES"
% jail_example_fdescfs_enable="YES"
% jail_example_procfs_enable="NO"
% jail_example_devfs_ruleset="devfsrules_jail"
% jail_example_mount_enable="YES"

It is possible to use /etc/jail/example:
% rootdir="/usr/jail/example"
% hostname="jail.example.org"
% ip="192.168.1.123"
% exec="/bin/sh /etc/rc"
% devfs_enable="YES"
% fdescfs_enable="YES"
% procfs_enable="NO"
% devfs_ruleset="devfsrules_jail"
% mount_enable="YES"

I don't know where to document it though.

Regards,
-- 
Jeremie Le Hen
< jeremie at le-hen dot org >< ttz at chchile dot org >



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