There are a few servers spread around the globe who reverse ssh into a jumpbox to expose certain ports. The autossh process is usually evoked on these boxes at the startup using rc.local

Here are the some behaviors that we noticed :

  • If the jumpbox is down at the client startup, the startup sequence is blocked at autossh.
  • Tried to use a screen session at the startup and pushed the autossh session into it. autossh exits after the timeout and we have to wait indefinitely till the client restarts to get the connection back.

Isn't autossh suppose to be fire and forget? Any tips as to wrap the autossh to invoke if not running?

  • Have you read the autossh manpage? The behavior you describe is clearly spelled out. It also mentions some environment variables for tuning timings of some events that may or may not be of interest. – B Layer Dec 23 '17 at 10:47
  • @BLayer Done that. Didn't find any suitable to configuration, hence the question of a wrapping option. – user1263746 Dec 23 '17 at 10:54
  • Okay. Sounded like the behavior wasn't known until encountered. But anyways, you should probably clarify what "wrap the autossh to invoke if not running" means. What exactly should the wrapper do? – B Layer Dec 23 '17 at 11:07
  • @BLayer Let the boot process continue and keep evoking autossh till the tunnel is active? I can write a while loop to achieve this, but I am curious as to what other people are doing. – user1263746 Dec 23 '17 at 12:30
  • Please edit your question and add those details there. I'm not aware of any generally available wrapper along those lines. Personally I'd just use simple shell scripting as you suggest. – B Layer Dec 23 '17 at 13:26

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Browse other questions tagged or ask your own question.