You are not logged in.

#1 2017-08-03 03:16:18

w88dy
Member
Registered: 2017-07-26
Posts: 9

sshfs hanging on improper disconnect

I'm attempting to get sshfs to automount on demand. I've managed to successfully get it to load on boot by adding the following to /etc/fstab:

user@host:/home/user/RemoteFolder /home/user/MountFolder fuse.sshfs noauto,x-systemd.automount,_netdev,users,idmap=user,Port=22,IdentityFile=/home/user/.ssh/id_rsa,allow_other,reconnect 0 0

Which works great and as expected. However, I've discovered that if the server fails for any reason (in my example, simply pulling the LAN cable) then any application using sshfs will crash/hang, specifically Nautilus. I've seen some suggestions on how to correct this issue using inline commands, but haven't been able to find any help to fix my issue with the fstab implementation.

I've tried adding additional commands, including:

ServerAliveInterval=15,ServerAliveCountMax=3

After 'reconnect' in my fstab line above, however it hasn't fixed my issue. Any suggestions would be appreciated.

Thanks.

Offline

#2 2017-08-03 05:44:15

seth
Member
From: Won't reply 2 private help req
Registered: 2012-09-03
Posts: 78,877

Offline

#3 2017-08-03 13:43:03

w88dy
Member
Registered: 2017-07-26
Posts: 9

Re: sshfs hanging on improper disconnect

seth wrote:

Thanks for the tip, but that's not it. The hang/freeze only occurs when the network is no longer available (i.e. me pulling the LAN cable).

Having just tested this again now, I don't think hang/freeze is the right word as I can still navigate through the left-side tabs in Nautilus, and open new instances of Nautilus, but whenever I click the 'Home' tab it will not load anything and all I get is a spinning wheel and 'loading...' in the bottom right of the Window.

Once I plug the LAN cable back in I get everything back within about 5 seconds. It feels like I'm almost there, I just need to get the system to handle the dropped connection correctly so that it still displays the folders in Home when there is no connection.

Offline

#4 2017-08-03 14:25:26

seth
Member
From: Won't reply 2 private help req
Registered: 2012-09-03
Posts: 78,877

Re: sshfs hanging on improper disconnect

Some preview feature? (looking into the folder)
You could "strace nautilus 2>&1 | grep -E '(stat|open)' to see what is approached.

Other things would be "nodiratime".

To be sure, you're aware that the ServerAlive* settings you use take a minute to time out?
Also ensure you didn't deactivate TCPKeepAlive eg. in the ssh config.

Offline

Board footer

Powered by FluxBB