sshfs-win icon indicating copy to clipboard operation
sshfs-win copied to clipboard

SSHFS -o reconnet not working

Open sganis opened this issue 7 years ago • 1 comments

The -o reconnect option is not working, it does not survive a short network disconnection. To reproduce, connect using the command line, then unplug the network for a moment and plug again. The terminal hangs for some time, and the this error appears:

failed to fork: Resource temporarily unavailable
read: Software caused connection abort
      2 [main] sshfs 8440 fork: child -1 - forked process 11836 died unexpectedly, 
      retry 0, exit code 0xC0000142, errno 11

The ssh.exe process does not start again. I think this issue is the same as #49.

I tried autossh using this command line option: -o ssh_command=autossh -M 0 -vv, but although it keeps the ssh.exe alive and trying to reconnnect, it does not restore the sshfs activity and the drive remains unavailable.

My setup:

WinFsp-FUSE version 2.8
SSHFS version 2.7
OpenSSH_7.5p1, OpenSSL 1.0.2k  26 Jan 2017
Local Windows 10
Remote Centos 7

My sshfs command line:

sshfs.exe [email protected]:/ Z: -f -o reconnect -ouid=-1,gid=-1
    -oVolumePrefix=/sshfs/[email protected] -oStrictHostKeyChecking=no 
    -oServerAliveInterval=10 -oServerAliveCountMax=10000 

sganis avatar Aug 08 '18 06:08 sganis

I am working around it with a PowerShell wrapper that automatically restarts the command if it exits.

PowerShell.exe -NoProfile -Command "while ($true) { & 'C:\Program Files\SSHFS-Win\bin\sshfs-win.exe' svc \sshfs.kr\myhost U:; Write-Host 'SSHFS exited, restarting in 10 seconds...' -ForegroundColor Red; Start-Sleep -Seconds 10 }"

felipecrs avatar Dec 23 '24 16:12 felipecrs