Each jail's specific data lives inside its own dataset:
Naturally, I thought that I could put some logic in exec.prepare, which performs this command before the jail attempts to mount anything. However, launch is failing with
/etc/jail.conf has the line:
So it seems that
Perhaps I'm missing an option or something? Rarely if ever have I felt like a certain logic/flow in FreeBSD should be different, but I think this one might make sense.
zusr/$name
. This includes the fstab, which (if the dataset is encrypted/unmounted), won't be available until zfs mount -l zusr/$name
.Naturally, I thought that I could put some logic in exec.prepare, which performs this command before the jail attempts to mount anything. However, launch is failing with
Code:
root@quBSD:~ # jail -vc $name
jail: $name: mount.fstab: /zusr/$name/rw/etc/fstab: No such file or directory
/etc/jail.conf has the line:
mount.fstab="/zusr/$name/rw/etc/fstab";
So it seems that
jail
wants to see the fstab file in existence, even before it actually attempts to run the mount command. While I can work around this by removing this line in jail.conf, and just doing it manually in the exec script, somehow I feel like this failure shouldn't happen until after exec.prepare finishes, seeing as how that's specifically reserved for actions to take before mounting. Actions such as unlocking/mounting the encrypted dataset, which might contain critical data for the jail.Perhaps I'm missing an option or something? Rarely if ever have I felt like a certain logic/flow in FreeBSD should be different, but I think this one might make sense.