Session management

Dan Bernstein brnstnd at kramden.acf.nyu.edu
Tue Aug 28 00:50:29 AEST 1990


In article <MOSS.90Aug27081600 at ibis.cs.umass.edu> moss at cs.umass.edu writes:
> An additional feature I definitely want is for the session manager to retain a
> session for some user-selectable time (with a system chosen upper bound) if
> the remote end drops before logout.

I agree, and pty does this too! It's very nice to be able to just flip
my terminal off in case of trouble, then reconnect later from anywhere.
I don't know how I lived without this feature.

pty doesn't implement the time limit: I was thinking of including it in
the code, but it's easy enough to do manually. (Under the session, check
every once in a while through sesslist. If the session is disconnected
and has the same signaller at two successive checks, kill -HUP all the
processes and sesskill the session.)

> I lose modem connections because of noise
> frequently, and it is really annoying to have to reconstruct my whole job tree
> when that happens.

Agreed. pty also lets you manually disconnect. This machine had to be
taken down a couple of days ago, but before that I had a single shell
running for a month. I just disconnected and reconnected every time,
saving on shell startup time, eliminating the need for vi -r, and
generally reducing angst.

> (The VMS pty stuff keeps sessions around as described, and
> when you relogin you get the option of connecting to your abandoned job or
> creating a new one.)

I source this script early in my login sequence (before aliases):

$HOME/links/sesslist
$HOME/links/sesslist | grep -s disconnected \
  && ( echo -n 'Reconnect to session (return to ignore): '; \
       set reconnect="$<"; \
       if ( a"$reconnect"b != ab ) exec sess reconnect "$reconnect"; \
     )

Primitive, but it gets the job done. A few minutes ago I just typed qf
and popped back into this session.

Once again, pty 3.001, the ultimate pseudo-terminal manager (implemented
for BSD variants only at the moment), will appear soon on c.s.unix. If
you're desperate, ask rsalz at bbn.com. If you're really desperate, anon
ftp to the pub/ directory on 128.122.128.22.

---Dan



More information about the Comp.unix.wizards mailing list