Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

snapcraft: prime fusermount3 binary #214

Merged
merged 1 commit into from
Nov 29, 2023

Conversation

simondeziel
Copy link
Member

With the move from fuse to fuse3, the package content changed:

from fuse:

/bin/fusermount (binary)

to fuse3:

/bin/fusermount -> fusermount (compat symlink)
/bin/fusermount3 (binary)

However, the snapcraft.yaml wasn't updated accordingly meaning that we only shipped the (broken) symlink:

$ ll /snap/lxd/current/bin/fusermount*
lrwxrwxrwx 1 root root 11 Mar 23  2022 /snap/lxd/current/bin/fusermount -> fusermount3

Note: this also affects the 5.0 branch (I'll send another PR after this one gets merged).

With the move from fuse to fuse3, the package content changed:

from fuse:

  /bin/fusermount (binary)

to fuse3:

  /bin/fusermount -> fusermount (compat symlink)
  /bin/fusermount3 (binary)

However, the snapcraft.yaml wasn't updated accordingly meaning
that we only shipped the (broken) symlink:

  $ ll /snap/lxd/current/bin/fusermount*
  lrwxrwxrwx 1 root root 11 Mar 23  2022 /snap/lxd/current/bin/fusermount -> fusermount3

Signed-off-by: Simon Deziel <[email protected]>
@simondeziel
Copy link
Member Author

@mihalicyn it seems the problem was introduced by commit 7d6f740 in Oct 2022, I'm surprised nobody noticed/complained for that long. I've only found fusermount being used in daemon.start and daemon.stop and always with failure ignored. Since it's related to lxcfs, I'd like to hear your thought on this, thanks!

While you are at it, would you mind checking if the libfuse.so bits in (https://github.com/canonical/lxd-pkg-snap/blob/latest-edge/snapcraft/commands/daemon.start#L490 and https://github.com/canonical/lxd-pkg-snap/blob/latest-edge/snapcraft/commands/daemon.start#L499) are still right considering this:

$ ll /snap/lxd/current/lib/x86_64-linux-gnu/*fuse*
lrwxrwxrwx 1 root root     18 Mar 23  2022 /snap/lxd/current/lib/x86_64-linux-gnu/libfuse3.so.3 -> libfuse3.so.3.10.5
-rw-r--r-- 1 root root 252088 Nov 28 07:12 /snap/lxd/current/lib/x86_64-linux-gnu/libfuse3.so.3.10.5

That doesn't look right to me but you are the SME.

@simondeziel
Copy link
Member Author

Or maybe the libfuse.so thingy is only meant for migration between fuse and fuse3? If yes, how long should we carry this?

@tomponline tomponline merged commit ce587d7 into canonical:latest-edge Nov 29, 2023
3 checks passed
@simondeziel simondeziel deleted the fuse3-binary branch November 29, 2023 13:41
@mihalicyn
Copy link
Member

@mihalicyn it seems the problem was introduced by commit 7d6f740 in Oct 2022, I'm surprised nobody noticed/complained for that long. I've only found fusermount being used in daemon.start and daemon.stop and always with failure ignored. Since it's related to lxcfs, I'd like to hear your thought on this, thanks!

Good catch! It should affect systemctl stop snap.lxd.daemon I guess and prevent the LXCFS from being stopped when LXD daemon is stopped.

That doesn't look right to me but you are the SME.

I agree with you. I think there should be something like sed -n "/libfuse3\?\.so/ s/.*libfuse3\?\.so\.\([^ ]\+\) .*/\1/p"

@mihalicyn
Copy link
Member

Or maybe the libfuse.so thingy is only meant for migration between fuse and fuse3? If yes, how long should we carry this?

This thing is about handling libfuse minor version upgrades. For example, when 2.7 becomes 2.8 we need to restart the whole LXCFS process to start using a new libfuse version. But this piece of code was not designed (and changed appropriately) to handle libfuse3. That's awesome that you have noticed that. ;)

@simondeziel
Copy link
Member Author

Or maybe the libfuse.so thingy is only meant for migration between fuse and fuse3? If yes, how long should we carry this?

This thing is about handling libfuse minor version upgrades. For example, when 2.7 becomes 2.8 we need to restart the whole LXCFS process to start using a new libfuse version. But this piece of code was not designed (and changed appropriately) to handle libfuse3. That's awesome that you have noticed that. ;)

Good that answers my next question about the need to keep this even after the transition to fuse3, thanks! Maybe we could make the sed work with both fuse and fuse3 to make it easier.

@mihalicyn
Copy link
Member

Maybe we could make the sed work with both fuse and fuse3 to make it easier.

yes, I guess that this sed -n "/libfuse3\?\.so/ s/.*libfuse3\?\.so\.\([^ ]\+\) .*/\1/p" should work for both libfuse version 2 and 3 as I have added a \? after a 3.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants