We have our own way of using nullfs to create a template jail, then mount several other jails on top of it. At one point I did a brief write up of it, for my own use, at http://home.roadrunner.com/~computertai ... sjail.html. It's based on this handbook page. http://www.freebsd.org/doc/handbook/jai ... ation.html, but is a bit simpler.
Recently, I tried this on FreeBSD-10. As folks might know, as of FreeBSD-10--actually, the man page has mentioned it earlier, but I've found it to be inconsistent--rather than adding devfs entries to /etc/rc.conf, one adds them to /etc/jail.conf.
While a standard jail works as expected with this, mounting /dev on a jail's /dev directory, the problem is that if I use the template method, where both the template jail, using nullfs and the new jail are both mounted on say, /jails/_jails1, devfs doesn't get properly mounted. If I use the mount command, it will show me that devfs is mounted where I want it to be, on jails/_jail1/dev, all I see on jails/_jail1/dev is null and log. I can then manually mount devfs with the
and devfs is mounted, (which makes me suspect that I've missed something somewhere.)
My /etc/jail.conf which works without problem with a standard jail is
I've been able to duplicate this on two machines, but before filing a pr, I'd like to do my best to confirm it's not something that I've missed.
Recently, I tried this on FreeBSD-10. As folks might know, as of FreeBSD-10--actually, the man page has mentioned it earlier, but I've found it to be inconsistent--rather than adding devfs entries to /etc/rc.conf, one adds them to /etc/jail.conf.
While a standard jail works as expected with this, mounting /dev on a jail's /dev directory, the problem is that if I use the template method, where both the template jail, using nullfs and the new jail are both mounted on say, /jails/_jails1, devfs doesn't get properly mounted. If I use the mount command, it will show me that devfs is mounted where I want it to be, on jails/_jail1/dev, all I see on jails/_jail1/dev is null and log. I can then manually mount devfs with the
mount -t devfs -o dev /jails/_jail1/devand devfs is mounted, (which makes me suspect that I've missed something somewhere.)
My /etc/jail.conf which works without problem with a standard jail is
Code:
jail1 {
path = /jails/_jail1;
mount.devfs;
devfs_ruleset = 4;
ip4.addr = 192.168.1.196;
exec.start = "/bin/sh /etc/rc";
exec stop = "/bin/sh etc/rc.shutdown";
Last edited: