Open jacobsvante opened 10 years ago
@jmagnusson & @hamiltont,
Just a heads up that https://github.com/signalfuse/maestro-ng uses bgtunnel and some users are hitting this issue, as discussed in https://github.com/signalfuse/maestro-ng/issues/63
Any input, fix or workaround would be appreciated!
Cheers
@mpetazzoni I didn't know they were using bgtunnel. I'm clogged with work right now so I'm not sure I will have time this month. In September things will hopefully look up. Any investigation into the issue or a PR is obviously of interest though ;-)
If I remember correctly, bgtunnel doesn't run any remote command at all, right? It just opens the connection, expects something like Ubuntu's "hello" message to be printed, and then sits around doing nothing while the tunnel is open in the background. I can't remember why I didn't just add a default command to the remote SSH session, such as ssh <blah> echo Alive
, which would guarantee output on every SSH server. Is there a reason this approach would not work inside of bgtunnel, which could then also allow removal of the expect_hello
option
@hamiltont That would exit the connection after finishing echo Alive
. But maybe there's a flag in SSH to keep it running after that, I don't know really.
@jmagnusson Yeah we use bgtunnel to offer a SSH-based secure connection to remote Docker daemons (docker-py now supports SSL, but that's sometimes harder to setup).
See the link I posted earlier (signalfuse/maestro-ng#63) for some details and some investigation.
Today bgtunnel's connection validation method expects the server to write to stdout on a successful connection. Not every server does this so @hamiltont introduced #6 which allows passing in
expect_hello=False
tobgtunnel.open
and thus bypassing the validation method. This workaround was added to0.3.6
.Perhaps something is written to stdout but the buffer is not flushed. Look this up.