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

Add option "idle_disconnect" #245

Closed
wants to merge 1 commit into from

Conversation

thatguystone
Copy link
Contributor

I have a few sshfs mounts that I always have mounted, but only occasionally access. It feels a bit wasteful to maintain ssh connections so that they can just sit there.

This adds a new option, -o idle_disconnect, that causes a connection to disconnect once it has been idle for some number of seconds.

When a connection has been idle for `idle_disconnect` seconds, it will be
terminated and restarted when needed.
@Nikratio
Copy link
Contributor

Thanks for the patch! I am not sure I like the idea though. Have you confirmed what happens if the idle timeout is exceeded while an application has a file open? It seems to me that this would probably not play well with closing the connection.

In general, wouldn't this usecase be better served by mounting the sshfs filesystem on demand (with automount)?

@thatguystone
Copy link
Contributor Author

Have you confirmed what happens if the idle timeout is exceeded while an application has a file open? It seems to me that this would probably not play well with closing the connection.

If any descriptor is still open, it falls through to process_one_request(), but I can always test it further

In general, wouldn't this usecase be better served by mounting the sshfs filesystem on demand (with automount)?

That's a great point. I actually ended up here because automounters currently run sshfs as root, and that made me really uncomfortable. There's been some discussion around fixing this, but so far, no movement.

It would probably be a better option for me to get some movement going with systemd rather than working around it here.

@Nikratio Nikratio closed this Aug 15, 2021
@Nikratio
Copy link
Contributor

Ok, will close this now then. Thanks for reporting back!

@thatguystone
Copy link
Contributor Author

This was merged in systemd/systemd#21315 and should be part of systemd 250.

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.

None yet

2 participants