Open ThomDietrich opened 8 months ago
I've encountered this issue a few times now so I'm keen to get this resolved.
Option 1 will not do anything. That setting only controls the behavior of the SSH client process when the SSH connection itself succeeded but forwarding the port failed (let's say the remote port is already occupied on the remote host).
In our case the issue is very likely to be networking (the add-on starts trying to connect before the network connection is up) so we wouldn't even get to a stage where that setting becomes relevant anyway, but even if it did, having ssh
stay running after failing to forward the port would be useless to us anyway.
Option 2 is the solution.
Option 3 is not a full solution. I have it enabled and yes it looks like it behaves like you described. The problem is that it has a max number of restarts and/or has a "burst" limit where lots of restarts in a short time will cause the watchdog to give up.
@Rjevski thanks for your response. I favored option 3 under the assumption that this watchdog behavior can be influenced. It did follow an infinite restart pattern some time ago and the "giving up" strategy is changed behavior since then. I wonder if that can be configured per add-on, which would make this the best solution. Long story short: I never looked into the behavior of the watchdog. Do you have any further knowledge?
After we have rules out option 3 as a viable option, I am more than happy to implement option 2 or to accept a PR.
I have opened the PR above - would you be able to test the following:
We had a power outage today. This lead to a weird constellation in which the autossh-addon wasn't able to connect and stopped after the run script was finished.
I assume there are similar causes for connection issues and I would like to ensure that the addon never stops trying to reconnect.
I see three options to fix this:
exit 1
?Option 3 is my favorite overall.
What do you think?