Skip to content

Commit

Permalink
snapcraft/commands/daemon.start: detect libfuse soname changes for fu…
Browse files Browse the repository at this point in the history
…se/fuse3

Signed-off-by: Simon Deziel <[email protected]>
  • Loading branch information
simondeziel committed Dec 8, 2023
1 parent de0e05e commit 7c093e5
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions snapcraft/commands/daemon.start
Original file line number Diff line number Diff line change
Expand Up @@ -487,7 +487,7 @@ fi
if [ -e "${SNAP_COMMON}/var/lib/lxcfs/cgroup" ]; then
echo "=> Re-using existing LXCFS"

NEW_FUSE=$(ldd "${SNAP_CURRENT}/bin/lxcfs" | sed -n "/libfuse\.so/ s/.*libfuse\.so\.\([^ ]\+\) .*/\1/p")
NEW_FUSE="$(ldd "${SNAP_CURRENT}/bin/lxcfs" | sed -n "/libfuse3\?\.so/ s/.*libfuse3\?\.so\.\([^ ]\+\) .*/\1/p")"
CURRENT_FUSE="${NEW_FUSE}"

NEW_BASE="$(grep ^name /meta/snap.yaml)"
Expand All @@ -496,7 +496,7 @@ if [ -e "${SNAP_COMMON}/var/lib/lxcfs/cgroup" ]; then
if [ -e "${SNAP_COMMON}/lxcfs.pid" ]; then
read -r CURRENT_PID < "${SNAP_COMMON}/lxcfs.pid"
if [ -e "/proc/${CURRENT_PID}" ]; then
CURRENT_FUSE=$(ldd "/proc/${CURRENT_PID}/exe" | sed -n "/libfuse\.so/ s/.*libfuse\.so\.\([^ ]\+\) .*/\1/p")
CURRENT_FUSE="$(ldd "/proc/${CURRENT_PID}/exe" | sed -n "/libfuse3\?\.so/ s/.*libfuse3\?\.so\.\([^ ]\+\) .*/\1/p")"
CURRENT_BASE="$(grep ^name "/proc/${CURRENT_PID}/root/meta/snap.yaml")"
fi
fi
Expand Down

0 comments on commit 7c093e5

Please sign in to comment.