Skip to content

Conversation

akotulskifc
Copy link

@akotulskifc akotulskifc commented Apr 20, 2023

Sometimes the remote has the port occupied (esp. when disconnect happens via a power cutoff).
https://serverfault.com/questions/512978/autossh-failed-recreating-a-tunnel-due-to-different-timing/563401#563401

Logs without the change:

autossh[13835]: Warning: remote port forwarding failed for listen port XXX

Autossh never connects until it's restarted. Which requires access to the machine

Logs with change:

autossh[14398]: starting ssh (count 2)
autossh[14398]: ssh child pid is 14431
autossh[14431]: Error: remote port forwarding failed for listen port XXX
autossh[14398]: ssh exited with error status 255; restarting ssh

autossh[14398]: starting ssh (count 3)
autossh[14398]: ssh child pid is 14432
autossh[14432]: Error: remote port forwarding failed for listen port XXX

After some time when remote port is freed, the service restarts and autossh connection is established

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.

1 participant