[Top][All Lists]

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

Re: simply preserving sessions across disconnect

From: Rich Boyce
Subject: Re: simply preserving sessions across disconnect
Date: Thu, 30 Jun 2011 14:01:06 +0100
User-agent: Mozilla/5.0 (X11; U; Linux x86_64; en-US; rv: Gecko/20110428 Fedora/3.1.10-1.fc14 Thunderbird/3.1.10

Hi Adam,

On 29/06/11 20:26, Adam Kellas wrote:
I think I failed to make the desired usage model clear. I gather most
people are in the mode of (a) log in, then (b) run "screen", and (c)
use screen thereafter to multiplex sessions. But my goal is to make
use of screen completely invisible[*]. In PuTTY one of the
configurables is the ssh "Remote Command" which by default is $SHELL.
I'm trying to configure putty with a remote command of "screen
<some-flags>" such that putty will automatically start up a screen
instance and that instance will either attach to an existing detached
session or create a new one. So one putty window == one screen window.
The idea is that this would be just like not using screen but sessions
aren't dropped when the network is.

That's precisely how I use screen. The way I do it is to have a snippet in my bash login script which tests whether the scripts is running in screen already, and if not runs 'screen -RR':

if [ ! $WINDOW ] ; then   # we're not already in screen
        if [ -e `which screen` ]; then  # we've got screen available
                screen -RR       # reattach to first available session
                exit             # logout when finished

Note that I'm working in a networked environment where my home area is the same on my local workstation and all the servers I connect to.

That works just how you're describing what you want. It's transparent during normal use, but if the connection to the remote server is lost then the session is restored upon reconnect.

Hope this helps!

Rich Boyce
Systems Administrator, Desktop Team
EBI Systems Group

reply via email to

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