Skip to content

Commit

Permalink
snapcraft/hooks/remove: also unmount /var/snap/lxd/shmounts
Browse files Browse the repository at this point in the history
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 <[email protected]>
(cherry picked from commit 3fdcce0)
  • Loading branch information
bboozzoo authored and tomponline committed Mar 15, 2024
1 parent 92c31e4 commit 51732a2
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion snapcraft/hooks/remove
Original file line number Diff line number Diff line change
Expand Up @@ -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

Expand Down

0 comments on commit 51732a2

Please sign in to comment.