From 51732a21792d795c5f9c4c0c415170a3af512144 Mon Sep 17 00:00:00 2001 From: Maciej Borzecki Date: Fri, 15 Mar 2024 13:37:52 +0100 Subject: [PATCH] snapcraft/hooks/remove: also unmount /var/snap/lxd/shmounts It may happen that the shmounts setup failed for whatever reason, in which case the fallback path mounts a tmpfs at /var/snap/lxd/shmounts. Make sure to clean it up during remove if needed. Signed-off-by: Maciej Borzecki (cherry picked from commit 3fdcce095d0e96b1ae38709e95ffbd0e79ada3db) --- snapcraft/hooks/remove | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/snapcraft/hooks/remove b/snapcraft/hooks/remove index c9e8f1ec0..34a2dff14 100755 --- a/snapcraft/hooks/remove +++ b/snapcraft/hooks/remove @@ -10,7 +10,7 @@ if [ -d /sys/kernel/security/apparmor ]; then fi # Unmount potential LXD paths. -for path in "${SNAP_COMMON}/ns/shmounts" "${SNAP_COMMON}/ns/mntns" "${SNAP_COMMON}/ns" "${SNAP_COMMON}/var/lib/lxcfs/"; do +for path in "${SNAP_COMMON}/ns/shmounts" "${SNAP_COMMON}/ns/mntns" "${SNAP_COMMON}/ns" "${SNAP_COMMON}/var/lib/lxcfs/" "${SNAP_COMMON}/shmounts"; do nsenter -t 1 -m umount -l "${path}" >/dev/null 2>&1 || true done