mdconfig doesn't work with exec.prestart.

I've set up a Debian jail on my system. Everything works as should.
However, when the jail is started, it doesn't attach the virtual disk to a memory disk and no log output is returned. If I attach the virtual disk manually the command is executed successfully (two memory disks).

Here's my jail.conf(5) file:
Code:
debian {
        host.hostname = debian.jail;
        ip4.addr = lo0|127.0.0.2/32;
        ip4.addr = wlan0|192.168.1.249/32;
        path = /opt/jails/debian;
        linux.osrelease = 4.19.0;
        
        exec.prestart = "mdconfig /home/debian.img";
        exec.start = "/etc/init.d/rc 3";
        exec.stop = "/etc/init.d/rc 0";
        persist;

        mount.devfs;
        mount.fstab = /etc/fstab.debian;

        allow.mount;
        allow.mount.devfs;
}

I'm using the latest release of FreeBSD, 12.1. I've tried everything possible to get it working. Is this likely to be a bug within jail.conf(5) and jail(8)?
 
Apparently, the mount parameters are run first before exec.prestart.

I've managed to get it to work by erasing the mount parameters and using exec.prestart to mount the file systems as well as the virtual disk.
Code:
exec.prestart = "mdmfs -T ext2fs -PF /home/debian.img 0 ${path} ; mount -aF /etc/fstab.debian";
 
Back
Top