nfsmount: fix exit after external unmount #7503

Before this change, if a user unmounted externally (for example, via the Finder
UI), rclone would not be aware of this and wait forever to exit -- effectively
causing a deadlock that would require Ctrl+C to terminate.

After this change, when the handler detects an external unmount, it calls a
function which allows rclone to cleanly shutdown the VFS and exit.
This commit is contained in:
nielash
2024-02-06 02:53:12 -05:00
parent 5638a3841f
commit 0e2f1d64e3
3 changed files with 32 additions and 4 deletions

View File

@@ -16,10 +16,11 @@ import (
// Server contains everything to run the Server
type Server struct {
opt Options
handler nfs.Handler
ctx context.Context // for global config
listener net.Listener
opt Options
handler nfs.Handler
ctx context.Context // for global config
listener net.Listener
UnmountedExternally bool
}
// NewServer creates a new server