Merge pull request #1206 from BastilleBSD/tschettervictor-patch-1

This commit is contained in:
tschettervictor
2025-07-31 07:32:23 -06:00
committed by GitHub

View File

@@ -337,7 +337,7 @@ post_create_jail() {
# Using relative paths here. # Using relative paths here.
# MAKE SURE WE'RE IN THE RIGHT PLACE. # MAKE SURE WE'RE IN THE RIGHT PLACE.
cd "${bastille_jail_path}" || error_exit "Could not cd to ${bastille_jail_path}" cd "${bastille_jail_path}" || error_exit "Could not access directory: ${bastille_jail_path}"
if [ ! -f "${bastille_jail_conf}" ]; then if [ ! -f "${bastille_jail_conf}" ]; then
if [ -z "${bastille_network_loopback}" ] && [ -n "${bastille_network_shared}" ]; then if [ -z "${bastille_network_loopback}" ] && [ -n "${bastille_network_shared}" ]; then
@@ -386,14 +386,20 @@ create_jail() {
if [ -n "${bastille_zfs_zpool}" ]; then if [ -n "${bastille_zfs_zpool}" ]; then
## create required zfs datasets, mountpoint inherited from system ## create required zfs datasets, mountpoint inherited from system
if [ -z "${CLONE_JAIL}" ]; then if [ -z "${CLONE_JAIL}" ]; then
zfs create ${bastille_zfs_options} "${bastille_zfs_zpool}/${bastille_zfs_prefix}/jails/${NAME}" if ! zfs create ${bastille_zfs_options} "${bastille_zfs_zpool}/${bastille_zfs_prefix}/jails/${NAME}"; then
error_exit "[ERROR]: Failed to create jail dataset: ${bastille_zfs_zpool}/${bastille_zfs_prefix}/jails/${NAME}"
fi
fi fi
if [ -z "${THICK_JAIL}" ] && [ -z "${CLONE_JAIL}" ]; then if [ -z "${THICK_JAIL}" ] && [ -z "${CLONE_JAIL}" ]; then
zfs create ${bastille_zfs_options} "${bastille_zfs_zpool}/${bastille_zfs_prefix}/jails/${NAME}/root" if ! zfs create ${bastille_zfs_options} "${bastille_zfs_zpool}/${bastille_zfs_prefix}/jails/${NAME}/root"; then
error_exit "[ERROR]: Failed to create jail root dataset: ${bastille_zfs_zpool}/${bastille_zfs_prefix}/jails/${NAME}/root"
fi
fi fi
fi fi
else else
mkdir -p "${bastille_jailsdir}/${NAME}/root" if ! mkdir -p "${bastille_jailsdir}/${NAME}/root"; then
error_exit "[ERROR]: Failed to create jail directory: ${bastille_jailsdir}/${NAME}/root"
fi
fi fi
# Check if the jail directory has been mounted under UFS (not supported) # Check if the jail directory has been mounted under UFS (not supported)
elif [ ! -d "${bastille_jailsdir}/${NAME}/root" ] && ! checkyesno bastille_zfs_enable; then elif [ ! -d "${bastille_jailsdir}/${NAME}/root" ] && ! checkyesno bastille_zfs_enable; then