autossh does not honor AUTOSSH_POLL environment variable
Affects | Status | Importance | Assigned to | Milestone | |
---|---|---|---|---|---|
autossh (Debian) |
New
|
Undecided
|
Unassigned | ||
autossh (Ubuntu) |
Confirmed
|
Undecided
|
Unassigned |
Bug Description
Description: Ubuntu 11.10
Release: 11.10
autossh:
Installed: 1.4b-6
Candidate: 1.4b-6
Version table:
*** 1.4b-6 0
500 http://
100 /var/lib/
It looks like AUTOSSH_POLL is not used unless AUTOSSH_FIRST_POLL is also used. See examples of me running it from the command line. You'll notice the "set alarm for XXX secs" messages. According to the documentation, if AUTOSSH_FIRST_POLL is not set, then it should default to AUTOSSH_POLL. That, plus AUTOSSH_POLL should have some effect if AUTOSSH_FIRST_POLL is not specified. The math in the second invocation is also wrong - net timeouts should be 1/2 of the short poll time; thus 1.5 seconds (or about there) instead of 1,500 seconds ... unless that's not seconds.
I started digging into why my ssh tunnels die because I've had an extremely high amount of problems today - I actually had terminals open and ssh was killed while I was typing into the remote shell. I still don't know why the connections are failing, but setting AUTOSSH_FIRST_POLL to AUTOSSH_POLL and keeping them both at 30 (double the default net timeout setting) seems to work for me.
12:59 Vubuntu:~$ AUTOSSH_DEBUG=1 AUTOSSH_POLL=30 autossh -M 63329 -qND 20005 -i /home/fidian/
autossh[3733]: checking for grace period, tries = 0
autossh[3733]: starting ssh (count 1)
autossh[3733]: ssh child pid is 3736
autossh[3733]: check on child 3736
autossh[3733]: set alarm for 600 secs
autossh[3736]: execing /usr/bin/ssh
^Cautossh[3733]: received signal to exit (2)
13:00 Vubuntu:~$ AUTOSSH_DEBUG=1 AUTOSSH_POLL=3 autossh -M 63329 -qND 20005 -i /home/fidian/
autossh[3764]: short poll time: adjusting net timeouts to 1500
autossh[3764]: checking for grace period, tries = 0
autossh[3764]: starting ssh (count 1)
autossh[3764]: ssh child pid is 3767
autossh[3764]: check on child 3767
autossh[3764]: set alarm for 600 secs
autossh[3767]: execing /usr/bin/ssh
^Cautossh[3764]: received signal to exit (2)
13:01 Vubuntu:~$ AUTOSSH_DEBUG=1 AUTOSSH_POLL=30 AUTOSSH_
autossh[3777]: checking for grace period, tries = 0
autossh[3777]: starting ssh (count 1)
autossh[3777]: ssh child pid is 3780
autossh[3780]: execing /usr/bin/
autossh[3777]: set alarm for 5 secs
autossh[3777]: connection ok
autossh[3777]: check on child 3780
autossh[3777]: set alarm for 30 secs
autossh[3777]: connection ok
autossh[3777]: check on child 3780
autossh[3777]: set alarm for 30 secs
^Cautossh[3777]: received signal to exit (2)
13:11 Vubuntu:~$ AUTOSSH_DEBUG=1 AUTOSSH_POLL=10 AUTOSSH_
autossh[4001]: short poll time: adjusting net timeouts to 5000
autossh[4001]: checking for grace period, tries = 0
autossh[4001]: starting ssh (count 1)
autossh[4001]: ssh child pid is 4004
autossh[4001]: check on child 4004
autossh[4001]: set alarm for 30 secs
autossh[4004]: execing /usr/bin/ssh
autossh[4001]: timeout polling to accept read connection
autossh[4001]: port down, restarting ssh
autossh[4001]: checking for grace period, tries = 0
autossh[4001]: starting ssh (count 2)
autossh[4001]: ssh child pid is 4010
autossh[4001]: check on child 4010
autossh[4001]: set alarm for 30 secs
autossh[4010]: execing /usr/bin/ssh
^Cautossh[4001]: received signal to exit (2)
Status changed to 'Confirmed' because the bug affects multiple users.