[Top][All Lists]

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Reestablishing ssh connections via screen: Conclusion

From: JCA
Subject: Reestablishing ssh connections via screen: Conclusion
Date: Sat, 25 Jun 2005 10:21:05 -0700

   I want to post a summary on this, in case somebody finds it useful.

  My setup is the following: I have a notebook that connects to a
server via ssh. The notebook is put to hibernate (suspended to disk)
every so often, for at least 15 minutes at a time. The server is
running nonstop. When put to hibernate, the notebook could possibly
have several ssh connections open with the server, every one of them
running separate applications, like editors, debuggers, etc.

  The problem: How to arrange things so that when the notebook is
brought back to life, the ssh connections are resumed, and the
applications that they were running, resumed at the same point where
they were when the hibernation started.

  The solution: Use a combination of autossh and screen. I modified
the rscreen script shipped with autossh, so that the line that invokes
autossh reads as follows:

  autossh -M -t $1 "screen -D -R -S Session-$NEXT"

  The reason why I added the -S option is because, without it, on
thawing the notebook autossh would create new screen sessions on the
server, leaving the interrupted ones still running, but detached. The
NEXT variable is increased by 1 everytime rscreen is onvoked.

  I am not claiming that this is perfect, or even the right way to do
it. It just seems to work for me though.

  Thanks so much to everybody who contributed to this thread.

reply via email to

[Prev in Thread] Current Thread [Next in Thread]