-
Notifications
You must be signed in to change notification settings - Fork 20
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 #99
Comments
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? |
I was able to reproduce this behavior with the following minimal example program:
|
Then I don't know the answer to your question as I have never tried to run applications with systemd. |
I've noticed fuse mounts are fussy with users. For example, I've tried to shell out to a sub-command prefixed with Any chance there is something similar regarding the unmounting? |
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? |
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.
I might be misunderstanding the question, but I'm running the service with this line in the service file to specify the user:
|
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. |
Sounds good. Thanks for chiming in so quickly! |
Please retry with an AppImage made using the latest https://github.com/AppImage/appimagetool/releases/tag/continuous, it might have been fixed in the lastest AppImage runtime by |
I extracted the appimage I used before and created a new one from that AppDir using the latest I tested this service file (appimage.service):
Using the following:
It works sometimes, but then other times the appimage hangs on exit. I'll see stdout in |
@nickjmeyer Could you add
|
By adding Here is the service file with the change:
And here's the output:
|
I suspected that the MR by @probonopd might have fixed the underlying issue and a bit systemd configuration magic might make service state more aligned with what you expect. By default, a service goes to
It looks like no processes were left behind at any point. So I think this is good? If |
This is probably my lack of understanding of fuse, but I don't quite understand how this would affect the service on exit. Is the fuse subsystem waiting for the main PID to exit in order to unmount, but it's not exiting for some reason? Curious if you have any insight into why this behavior change allows the unmounting to happen cleanly.
Yup! I ran this
to stress test it. Each of the 100 iterations started / stopped as expected and there were no orphaned mounts. So this definitely seems like a fix. I can easily accommodate needing to explicitly Thanks a ton for the help! |
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?
The text was updated successfully, but these errors were encountered: