Solved mount_nullfs: /jails/acme/usr/local/etc/step: Resource deadlock avoided

The jail configuration is
Code:
# /root/acme-jail/jail.conf
acme {
exec.start = "/bin/sh /etc/rc";
exec.stop  = "/bin/sh /etc/rc.shutdown";
exec.consolelog = "/var/log/jail_console_${name}.log";

allow.raw_sockets;
allow.reserved_ports;
exec.clean;
mount.devfs;
devfs_ruleset = 5;

path = "/jails/${name}";
host.hostname = "${name}";

$id = "5";
$ip = "192.168.0.${id}/24";
$gateway = "192.168.0.1";
$bridge = "bridge0";
$epair = "epair${id}";

vnet;
vnet.interface = "${epair}b";

mount.fstab = "/root/acme-jail/fstab";

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";
}
# /root/acme-jail/fstab
/jails/var-acme/        /jails/acme/usr/local/etc/step  nullfs  rw      0       5
/jails/var-acme/        /jails/acme/etc/step-ca nullfs  rw      0       5
Trying to run the Jail, goes like this:
Code:
# jail -crm -f etc/acme.conf
mount_nullfs: /jails/acme/usr/local/etc/step: Resource deadlock avoided
jail: acme: /sbin/mount -t nullfs -o rw /jails/var-acme/ /jails/acme/usr/local/etc/step: failed
Have presetup the jail with
Code:
#!/bin/sh

JAIL_ROOT="/jails/acme"
zfs clone zroot/jails/template@start "zroot/${JAIL_ROOT}"
zfs snapshot "zroot/${JAIL_ROOT}@start"
mkdir -p "${JAIL_ROOT}/usr/local/etc/step"
mkdir -p "${JAIL_ROOT}/etc/step-ca"
 
i found that mounts specified in the fstab
weren't umounted when shutting down the jail

Code:
mount.fstab = "/root/acme-jail/fstab";

however using the mount option in the jails config
does automatically unmount all the mountpoints when shutting down the jail

Code:
/etc/jail.conf.d/rocky.conf

Code:
rocky {
    # hostname/path
    host.hostname = "${name}";
    path = "/usr/local/jails/linux/${name}";

    # permissions
    allow.raw_sockets;
    exec.clean;
    persist;
    sysvmsg=inherit;
    sysvsem=inherit;
    sysvshm=inherit;
    enforce_statfs=1;

    # permissions
    devfs_ruleset=7;

    # network
    ip4.addr="lo1|10.10.0.5/24";

    # mount
    mount += "devfs           $path/dev      devfs           rw                      0       0";
    mount += "tmpfs           $path/dev/shm  tmpfs           rw,size=1g,mode=1777    0       0";
    mount += "fdescfs         $path/dev/fd   fdescfs         rw,linrdlnk             0       0";
    mount += "linprocfs       $path/proc     linprocfs       rw                      0       0";
    mount += "linsysfs        $path/sys      linsysfs        rw                      0       0";
    mount += "/tmp            $path/tmp      nullfs          rw                      0       0";
    mount += "/home           $path/home     nullfs          rw                      0       0";

    # mount the video directory from the host to the jail after creating it
    mount += "/home/djwilcox/video $path/home/djwilcox/video  nullfs rw      0       0";
    # uncomment the line below for the xdg runtime directory for wayland after creating it
    mount += "/var/run/xdg/djwilcox $path/run/user/1001  nullfs rw            0       0";
}
 
i found that mounts specified in the fstab
weren't umounted when shutting down the jail

Code:
mount.fstab = "/root/acme-jail/fstab";

however using the mount option in the jails config
does automatically unmount all the mountpoints when shutting down the jail

Code:
/etc/jail.conf.d/rocky.conf

Code:
rocky {
    # hostname/path
    host.hostname = "${name}";
    path = "/usr/local/jails/linux/${name}";

    # permissions
    allow.raw_sockets;
    exec.clean;
    persist;
    sysvmsg=inherit;
    sysvsem=inherit;
    sysvshm=inherit;
    enforce_statfs=1;

    # permissions
    devfs_ruleset=7;

    # network
    ip4.addr="lo1|10.10.0.5/24";

    # mount
    mount += "devfs           $path/dev      devfs           rw                      0       0";
    mount += "tmpfs           $path/dev/shm  tmpfs           rw,size=1g,mode=1777    0       0";
    mount += "fdescfs         $path/dev/fd   fdescfs         rw,linrdlnk             0       0";
    mount += "linprocfs       $path/proc     linprocfs       rw                      0       0";
    mount += "linsysfs        $path/sys      linsysfs        rw                      0       0";
    mount += "/tmp            $path/tmp      nullfs          rw                      0       0";
    mount += "/home           $path/home     nullfs          rw                      0       0";

    # mount the video directory from the host to the jail after creating it
    mount += "/home/djwilcox/video $path/home/djwilcox/video  nullfs rw      0       0";
    # uncomment the line below for the xdg runtime directory for wayland after creating it
    mount += "/var/run/xdg/djwilcox $path/run/user/1001  nullfs rw            0       0";
}
It certainly solved my issue, but I don't think that non unmounted filesystems are the problem, as I checked with 'mount | grep acme', and only the ZFS entry for the root of the Jail, and no more, probably this merits a Problem Report. Thanks.
 
Back
Top