Don't set jail ZFS dataset mountpoint, let be inherited from the system
This commit is contained in:
@@ -122,10 +122,10 @@ create_jail() {
|
|||||||
if [ ! -d "${bastille_jailsdir}/${NAME}" ]; then
|
if [ ! -d "${bastille_jailsdir}/${NAME}" ]; then
|
||||||
if [ "${bastille_zfs_enable}" = "YES" ]; then
|
if [ "${bastille_zfs_enable}" = "YES" ]; then
|
||||||
if [ ! -z "${bastille_zfs_zpool}" ]; then
|
if [ ! -z "${bastille_zfs_zpool}" ]; then
|
||||||
## create required zfs datasets
|
## create required zfs datasets, mountpoint inherited from system
|
||||||
zfs create ${bastille_zfs_options} ${bastille_zfs_zpool}/${bastille_zfs_prefix}/jails/${NAME}
|
zfs create ${bastille_zfs_options} ${bastille_zfs_zpool}/${bastille_zfs_prefix}/jails/${NAME}
|
||||||
if [ -z "${THICK_JAIL}" ]; then
|
if [ -z "${THICK_JAIL}" ]; then
|
||||||
zfs create ${bastille_zfs_options} -o mountpoint=${bastille_jailsdir}/${NAME}/root ${bastille_zfs_zpool}/${bastille_zfs_prefix}/jails/${NAME}/root
|
zfs create ${bastille_zfs_options} ${bastille_zfs_zpool}/${bastille_zfs_prefix}/jails/${NAME}/root
|
||||||
fi
|
fi
|
||||||
fi
|
fi
|
||||||
else
|
else
|
||||||
|
|||||||
@@ -78,6 +78,14 @@ update_zfsmount() {
|
|||||||
echo -e "${COLOR_GREEN}Updating zfs mountpoint...${COLOR_RESET}"
|
echo -e "${COLOR_GREEN}Updating zfs mountpoint...${COLOR_RESET}"
|
||||||
zfs set mountpoint=${bastille_jailsdir}/${TARGET_TRIM}/root ${bastille_zfs_zpool}/${bastille_zfs_prefix}/jails/${TARGET_TRIM}/root
|
zfs set mountpoint=${bastille_jailsdir}/${TARGET_TRIM}/root ${bastille_zfs_zpool}/${bastille_zfs_prefix}/jails/${TARGET_TRIM}/root
|
||||||
fi
|
fi
|
||||||
|
|
||||||
|
# Mount new container ZFS datasets
|
||||||
|
if ! zfs mount | grep "${bastille_zfs_zpool}/${bastille_zfs_prefix}/jails/${TARGET_TRIM}"; then
|
||||||
|
zfs mount ${bastille_zfs_zpool}/${bastille_zfs_prefix}/jails/${TARGET_TRIM}
|
||||||
|
fi
|
||||||
|
if ! zfs mount | grep "${bastille_zfs_zpool}/${bastille_zfs_prefix}/jails/${TARGET_TRIM}/root"; then
|
||||||
|
zfs mount ${bastille_zfs_zpool}/${bastille_zfs_prefix}/jails/${TARGET_TRIM}/root
|
||||||
|
fi
|
||||||
}
|
}
|
||||||
|
|
||||||
update_jailconf() {
|
update_jailconf() {
|
||||||
@@ -128,9 +136,6 @@ jail_import() {
|
|||||||
# This is required on foreign imports only
|
# This is required on foreign imports only
|
||||||
update_zfsmount
|
update_zfsmount
|
||||||
|
|
||||||
# Mount new container ZFS datasets
|
|
||||||
zfs mount ${bastille_zfs_zpool}/${bastille_zfs_prefix}/jails/${TARGET_TRIM}
|
|
||||||
zfs mount ${bastille_zfs_zpool}/${bastille_zfs_prefix}/jails/${TARGET_TRIM}/root
|
|
||||||
elif [ "${FILE_EXT}" = "txz" ]; then
|
elif [ "${FILE_EXT}" = "txz" ]; then
|
||||||
# Prepare the ZFS environment and restore from existing tar.xz file
|
# Prepare the ZFS environment and restore from existing tar.xz file
|
||||||
echo -e "${COLOR_GREEN}Importing '${TARGET_TRIM}' form .${FILE_EXT} archive.${COLOR_RESET}"
|
echo -e "${COLOR_GREEN}Importing '${TARGET_TRIM}' form .${FILE_EXT} archive.${COLOR_RESET}"
|
||||||
|
|||||||
Reference in New Issue
Block a user