From 9b3fde59b83509e1402b19ce859ea1806c7af571 Mon Sep 17 00:00:00 2001 From: Jose Date: Fri, 21 Feb 2020 11:35:35 -0400 Subject: [PATCH] Fix Thickjail mountpoint inheritance in the root dataset --- usr/local/share/bastille/create.sh | 3 ++- usr/local/share/bastille/import.sh | 2 +- 2 files changed, 3 insertions(+), 2 deletions(-) diff --git a/usr/local/share/bastille/create.sh b/usr/local/share/bastille/create.sh index 81edec22..6a19acf8 100644 --- a/usr/local/share/bastille/create.sh +++ b/usr/local/share/bastille/create.sh @@ -298,7 +298,8 @@ create_jail() { ## replicate the release base to the new thickjail and set the default mountpoint zfs send -R "${bastille_zfs_zpool}/${bastille_zfs_prefix}/releases/${RELEASE}"@"${SNAP_NAME}" | \ zfs receive "${bastille_zfs_zpool}/${bastille_zfs_prefix}/jails/${NAME}/root" - zfs set ${ZFS_OPTIONS} mountpoint="${bastille_jailsdir}/${NAME}/root" "${bastille_zfs_zpool}/${bastille_zfs_prefix}/jails/${NAME}/root" + zfs set ${ZFS_OPTIONS} mountpoint=none "${bastille_zfs_zpool}/${bastille_zfs_prefix}/jails/${NAME}/root" + zfs inherit mountpoint "${bastille_zfs_zpool}/${bastille_zfs_prefix}/jails/${NAME}/root" ## cleanup temp snapshots initially zfs destroy "${bastille_zfs_zpool}/${bastille_zfs_prefix}/releases/${RELEASE}"@"${SNAP_NAME}" diff --git a/usr/local/share/bastille/import.sh b/usr/local/share/bastille/import.sh index 4b77c8a2..f67f2ab6 100644 --- a/usr/local/share/bastille/import.sh +++ b/usr/local/share/bastille/import.sh @@ -218,7 +218,7 @@ jail_import() { rm -f "${FILE_TRIM}" "${FILE_TRIM}_root" fi echo -e "${COLOR_GREEN}Receiving zfs data stream...${COLOR_RESET}" - zfs receive "${bastille_zfs_zpool}/${bastille_zfs_prefix}/jails/${TARGET_TRIM}" < "${FILE_TRIM}" + zfs receive -u "${bastille_zfs_zpool}/${bastille_zfs_prefix}/jails/${TARGET_TRIM}" < "${FILE_TRIM}" zfs set ${ZFS_OPTIONS} "${bastille_zfs_zpool}/${bastille_zfs_prefix}/jails/${TARGET_TRIM}" zfs receive "${bastille_zfs_zpool}/${bastille_zfs_prefix}/jails/${TARGET_TRIM}/root" < "${FILE_TRIM}_root"