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

AppImage not unmounting when running as systemd service #1362

Open
nickjmeyer opened this issue Nov 23, 2024 · 8 comments
Open

AppImage not unmounting when running as systemd service #1362

nickjmeyer opened this issue Nov 23, 2024 · 8 comments

Comments

@nickjmeyer
Copy link

I have an AppImage that when run on the command line, works just fine. Executes as expected and cleans up the mount point on exit. However, when run as a systemd service, regardless if it exists cleanly or with a failure, the mount point is left behind in /tmp. This ends up accumulating a bunch of stale fuse mounts and after long enough the mount limit is reached and no more appimages can be run.

Any ideas why running as a systemd service might prevent the mount point from getting cleaned up?

@probonopd
Copy link
Member

While the service is running, the AppImage should be mounted. Once the application inside the AppImage exits, the AppImage should get unmounted. This only works when the application inside the AppImage is quit properly. How does the application inside your AppImage get quit?

@nickjmeyer
Copy link
Author

I was able to reproduce this behavior with the following minimal example program:

int main() { return 0; }

@probonopd
Copy link
Member

Then I don't know the answer to your question as I have never tried to run applications with systemd.

@nickjmeyer
Copy link
Author

nickjmeyer commented Nov 23, 2024

I've noticed fuse mounts are fussy with users. For example, I've tried to shell out to a sub-command prefixed with sudo and from some research it seems the allow_user config flag is needed to allow other users besides the one who mounted it to execute within the mount.

Any chance there is something similar regarding the unmounting?

@probonopd
Copy link
Member

Just to be sure, in your minimal example program your AppImage properly unmounts when NOT launched by systemd?

As which user is systemd running your AppImage?

@nickjmeyer
Copy link
Author

nickjmeyer commented Nov 23, 2024

Just to be sure, in your minimal example program your AppImage properly unmounts when NOT launched by systemd?

That's correct. The AppImage works just as expected when run outside systemd (e.g., on the command line) and on exit the fuse mount is properly unmounted.

As which user is systemd running your AppImage?

I might be misunderstanding the question, but I'm running the service with this line in the service file to specify the user:

[Service]
User=myuser

@probonopd
Copy link
Member

Unfortunately I don't know the answer, or how to debug this. But we can leave this issue open in case someone more knowledgeable about systemd sees this.

@nickjmeyer
Copy link
Author

Sounds good. Thanks for chiming in so quickly!

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

No branches or pull requests

2 participants