jails in FreeBSD 10

It's also mentioned in /usr/src/UPDATING:
Code:
20131010:
        The rc.d/jail script has been updated to support jail(8)
        configuration file.  The "jail_<jname>_*" rc.conf(5) variables
        for per-jail configuration are automatically converted to
        /var/run/jail.<jname>.conf before the jail(8) utility is invoked.
        This is transparently backward compatible.  See below about some
        incompatibilities and rc.conf(5) manual page for more details.

        These variables are now deprecated in favor of jail(8) configuration
        file.  One can use "rc.d/jail config <jname>" command to generate
        a jail(8) configuration file in /var/run/jail.<jname>.conf without
        running the jail(8) utility.   The default pathname of the
        configuration file is /etc/jail.conf and can be specified by
        using $jail_conf or $jail_<jname>_conf variables.

        Please note that jail_devfs_ruleset accepts an integer at
        this moment.  Please consider to rewrite the ruleset name
        with an integer.
 
I have a page that covers this at http://home.roadrunner.com/~computertai ... djail.html. (Just search for jail.conf on the page, it's around the middle of it.)

The man page, even for 9.x, states that you should use /etc/jail.conf, but in practice, I found that it seemed to be ignored. (I didn't investigate it thoroughly, it worked with /etc/rc.conf, so that's what I did.).

However, in 10.x, it's apparently necessary to use /etc/jail.conf. This has been my experience, and again, not heavily tested. My procedure was to try the conf file in 9.x, find it didn't work, put the lines in /etc/rc.conf, and continue to use that in 9.x. On FreeBSD-10, once again tried with /etc/jail.conf, found that it worked, with
Code:
jail_enable="YES"
as the only jail reference in /etc/rc.conf, and that was the extent of my testing.
 
I think on 9.x you need to use jail2_enable="YES" instead of jail_enable="YES" to make it use /etc/jail.conf.
 
Ok, just tested this in a VM. I created a jail, and put
Code:
jails2_enable="YES"
in /etc/rc.conf. At that point, it told me that I should add
Code:
jail_enable="YES"
to /etc/rc.conf. As far as I can tell, my post above was correct, one needs to install the jails2 port for the jails2_enable part to work. I didn't take it that far though, as it's not something I would bother to do. (That doesn't mean it's bad--it's probably better to get jails working with the jails.conf file, which will mean less work if a system is upgraded to FreeBSD-10--it just means that for my needs, it's work and testing that I don't feel like doing.)

So, I'll go with my original statement, that 9.x seems to still use entries in /etc/rc.conf.
 
Back
Top