[Top][All Lists]

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

Re: Reestablishing ssh connections via screen: Conclusion

From: Eric D. Hendrickson
Subject: Re: Reestablishing ssh connections via screen: Conclusion
Date: Sat, 25 Jun 2005 13:50:08 -0500
User-agent: Gnus/5.1006 (Gnus v5.10.6) XEmacs/21.4 (Jumbo Shrimp, linux)

I don't understand why you don't just run one ssh session to the
server, and run screen there with as many windows as you need for all
the applications you are using, etc.

When your notebook goes into hibernation, either start a new ssh
connection or use the autossh as below to resume your ssh connection
to the server, and recover your screen with screen -r or screen -x.

Everything is still there as it was since only that one ssh connection
was affected by your notebook hibernation and screen went into the
background when the ssh connection was lost.

See the man page for more details on -r and -x.

Personally, I use screen -A -x almost daily.

Best regards,
Eric Hendrickson

JCA <address@hidden> writes:

>    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.
> _______________________________________________
> screen-users mailing list
> address@hidden

reply via email to

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