image: improve the autossh behaviour
authorKristof Provost <kp@FreeBSD.org>
Thu, 13 Feb 2025 20:36:14 +0000 (21:36 +0100)
committerKristof Provost <kp@FreeBSD.org>
Thu, 13 Feb 2025 20:36:14 +0000 (21:36 +0100)
Poll regularly and occasionally automatically reconnect.
We've seen at least some instances of ssh remaining up but the reverse tunnel
becoming unusable. Hopefully this will improve things.
This can be recovered by terminating the ssh process on kosmos, but reconnection
takes a while.

image/overlay/domotica/etc/rc.d/autossh

index a91df8d..cb149bb 100755 (executable)
@@ -18,7 +18,8 @@ autossh_start()
 
        /usr/local/bin/sudo -u kp \
            /usr/local/bin/tmux new-session -d \
-           "autossh -M 0 -p 2207 -N -R ${control_port}:localhost:22 \
+           "AUTOSSH_POLL=120 AUTOSSH_MAXLIFETIME=28800 \
+           autossh -M 0 -p 2207 -N -R ${control_port}:localhost:22 \
            -R ${http_port}:localhost:8123 \
            -o ExitOnForwardFailure=yes \
            domotica@kosmos.sigsegv.be"