I'm using sshfs to mount and interact with directories and files located on a remote server. The command I'm using is:
sshfs -o follow_symlinks host:dir mountpoint -o reconnect
Sometimes, after a period of inactivity, when I wake up the computer from the suspended mode, processes that use a resource on the remote server do not respond anymore.
It mainly happens for the Nautilus (Files) and can happen for Okular if an opened PDF file is located on the remote server.
Trying to kill those processes with kill -9
does not work. For example, when the Nautilus doesn't respond, here are the command I'm using to try to kill the process:
toto:~/.ssh$ ps aux | grep nautilus
toto 21435 0.4 0.3 1440760 123276 ? Sl 09:32 1:48 /usr/bin/nautilus --gapplication-service
toto 96139 0.0 0.0 9216 2428 pts/4 S+ 15:44 0:00 grep --color=auto nautilus
toto:~/.ssh$ kill -9 21435
I've learned here this is because they are in uninterruptible sleep. From this other discussion, I thought a solution was to use -o reconnect
as parameter for sshfs. Unfortunately, I still get apps that do not respond after the computer wakes up.
ps -ef | grep sshfs
. I think it could be nice to add it to your answer. It takes me a little time to understand that the "parent" process was the one generated by the sshfs command. I'll make a few more tests with the ServerAliveInterval to see if the problem persists or not. – TVG Jun 12 '23 at 18:34system service
that automatically reconnects the SSHFS mount when the client wakes up from sleep. Use tools likesystemd (system service)
or creating a custom script that detects the client'ssleep/wake events
and triggers the reconnection process. – Z0OM Jun 13 '23 at 08:03system service
. Let's see first ifServerAliveInterval
solved the problem. – TVG Jun 13 '23 at 11:14