Re: RFC for wider rc.conf.d/ for jails

From: Jeremie Le Hen <jeremie_at_le-hen.org>
Date: Mon, 30 Jul 2007 22:16:04 +0200
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 >
Received on Mon Jul 30 2007 - 18:15:12 UTC

This archive was generated by hypermail 2.4.0 : Wed May 19 2021 - 11:39:15 UTC