rc.d/jail: add legacy compatibility for zfs.dataset

Evaluate the jail_${jailname}_zfs_dataset variable for legacy
jail managers.

This variable can take a space separated list of datasets.
The singular was used specially to allow unmaintained jail
managers like ezjail to use this (simply rename
jail_${jailname}_zfs_datasets in the ezjail config to
jail_${jailname}_zfs_dataset).
This commit is contained in:
Alexander Leidinger 2024-01-17 13:32:39 +01:00
parent 6caa19a08b
commit 0b49e504a3

View File

@ -268,6 +268,13 @@ parse_options()
extract_var $_jv enforce_statfs enforce_statfs - 2
extract_var $_jv osreldate osreldate
extract_var $_jv osrelease osrelease
_zfs_dataset="$(eval echo \$jail_${_jv}_zfs_dataset)"
if [ -n "$_zfs_dataset" ]; then
for ds in $_zfs_dataset; do
echo " zfs.dataset += ${ds};"
done
fi
for _p in $_parameters; do
echo " ${_p%\;};"
done