After starting the jail with
Configuration:
jail -crm -f /etc/jail.conf.d/nfs.conf
, when I try to create a new filesystem jexec nfs zfs create -o mountpoint=/test zpool/jails/nfs/test
I get the error
Code:
cannot create 'zpool/jails/nfs/test': permission denied
Configuration:
/etc/jail.conf.d/nfs.conf
Code:
nfs {
exec.clean;
exec.start = "/bin/sh /etc/rc";
exec.stop = "/bin/sh /etc/rc.shutdown jail";
exec.consolelog = "/var/log/jail_console_${name}.log";
allow.raw_sockets;
allow.mount;
allow.mount.zfs;
mount.devfs;
enforce_statfs = 2;
devfs_ruleset = 16;
path = "/jails/${name}";
host.hostname = "${name}";
$id = "6";
$ip = "192.168.0.${id}/24";
$gateway = "192.168.0.1";
$bridge = "bridge0";
$epair = "epair${id}";
vnet;
vnet.interface = "${epair}b";
exec.created += "zfs jail nfs zpool/jails/nfs";
exec.prestart = "/sbin/ifconfig ${epair} create up";
exec.prestart += "/sbin/ifconfig ${epair}a up descr jail:${name}";
exec.prestart += "/sbin/ifconfig ${bridge} addm ${epair}a up";
exec.start += "/sbin/ifconfig ${epair}b ${ip} up";
exec.start += "/sbin/route add default ${gateway}";
exec.poststop = "/sbin/ifconfig ${bridge} deletem ${epair}a";
exec.poststop += "/sbin/ifconfig ${epair}a destroy";
exec.release += "zfs unjail nfs zpool/jails/nfs";
}
/etc/devfs.rules
Code:
[devfs_rules_nfs_jail=16]