[comp.unix.questions] How to connect to a disconnected process ?

zhou@linac.fnal.gov (Ping Zhou) (10/05/90)

I have been annoyed by this for quite a while - being disconnected due to modem
or other reasons, and I have to relogin and redo a lot of things. So I have
been wondering - is there any way and/or software that will let you to
reconnect to the disconnected process when, or after, you relogin ?  Or
just for the purpose of education, what does it take to realize this on
Unix machines (VMS does this when you relogin) ?

Any help will be appreciated. (If this has been discussed before, email please)

--
Ping zhou@linac.fnal.gov

Dan_Jacobson@ATT.COM (10/07/90)

>>>>> On 5 Oct 90 04:55:12 GMT, zhou@linac.fnal.gov (Ping Zhou) said:

Ping> for the purpose of education, what does it take to realize this
Ping> on Unix machines (VMS does this when you relogin) ?

It takes Oliver Laumann's "screen" program and a Sun/BSD system.
See "screen2" in comp.sources.unix archives.

[At least it did this for me.  It also allows you travel around,
reconnecting to your session from other people's offices, home, etc.]

"Some restrictions apply.  In stereo where avaiable."
-- 
Dan_Jacobson@ATT.COM  Naperville IL USA  +1 708-979-6364

brnstnd@kramden.acf.nyu.edu (Dan Bernstein) (10/08/90)

In article <1990Oct7.093722.3558@cbnewse.att.com> danj1@ihlpa.att.com writes:
> It takes Oliver Laumann's "screen" program and a Sun/BSD system.

Or my pty program and a BSD-derived system. pty only manages
pseudo-terminals; it doesn't come with all the baggage (Oliver would say
feature) of display management. It handles everything you'd want out of
pseudo-terminal sessions, though.

---Dan

net@tub.UUCP (Oliver Laumann) (10/09/90)

In article <2064:Oct803:34:3790@kramden.acf.nyu.edu> brnstnd@kramden.acf.nyu.edu (Dan Bernstein) writes:
> > It takes Oliver Laumann's "screen" program and a Sun/BSD system.
> 
> pty only manages pseudo-terminals; it doesn't come with all the baggage
> (Oliver would say feature) of display management.

Considering that the purpose of "screen" is to manage displays I wonder
why you call the display management functionality "baggage".

In addition, I wish you would stop putting words into my mouth and stop
the "screen" bashing in this newsgroup.

Thanks.

--
    Oliver Laumann, Technical University of Berlin, Germany.
    pyramid!tub!net   net@TUB.BITNET   net@tub.cs.tu-berlin.de

kmeek@cti1.UUCP (Kevin Meek) (10/10/90)

brnstnd@kramden.acf.nyu.edu (Dan Bernstein) writes:


>Or my pty program and a BSD-derived system. pty only manages
>pseudo-terminals; it doesn't come with all the baggage (Oliver would say
>feature) of display management. It handles everything you'd want out of
>pseudo-terminal sessions, though.

What if you don't have a BSD system?  Is there any way to connect 
to psuedo tty's once your network connection has been terminated?

Occasionally we get locked up when connecting over a tcp/ip telnet connection
and have to reboot our PC's when we connect again another session is
started and processes that got locked up won't die -- can we connect
to these and have them log out gracefully?

Kevin Meek    --   kmeek@cti.com
Comprehensive Technologies Int'l Inc.
2121 Crystal Drive   Suite #103
Arlington,  VA  22202

brnstnd@kramden.acf.nyu.edu (Dan Bernstein) (10/12/90)

Technical content of this article: ``sess emacs'' is much more efficient
than ``screen emacs'' if you just want a reconnectable session, because
sess (part of pty) doesn't come with the virtual terminal baggage of
screen. The flip side of this is that pty will not, in fact, give you
the virtual terminal features of screen, so if you want to use those
features then you're out of luck. Okay, you can press 'n' now.

In article <1769@tub.UUCP> net@tub.UUCP (Oliver Laumann) writes:
> In article <2064:Oct803:34:3790@kramden.acf.nyu.edu> brnstnd@kramden.acf.nyu.edu (Dan Bernstein) writes:
> > > It takes Oliver Laumann's "screen" program and a Sun/BSD system.
> > pty only manages pseudo-terminals; it doesn't come with all the baggage
> > (Oliver would say feature) of display management.
> Considering that the purpose of "screen" is to manage displays I wonder
> why you call the display management functionality "baggage".

See? I was right. You are saying that it's a feature.

For the problem at hand, namely reconnecting to a disconnected process,
pty is much better: it handles these session management jobs without
forcing the baggage of virtual terminal management upon you as well.
It doesn't go through each character checking for terminal codes. In
fact, if you integrate pty into telnetd with the patches provided in the
pty package, your system loses absolutely nothing in efficiency. Making
interactive I/O several times slower qualifies as baggage.

For the problem of showing multiple windows on a tty, pty is not so
useful. screen was designed with the feature of virtual terminal
management. A virtual terminal program (such as screen itself) could be
wrapped around pty, but such a modular wrapper is not yet available. So
if the question were about display management, I would recommend screen
without any reservation. Windows and virtual terminals qualify as
features.

``Baggage'' and ``feature'' must be taken in context. A feature turns
into baggage when you don't want to use it.

> In addition, I wish you would stop putting words into my mouth and stop
> the "screen" bashing in this newsgroup.

C'mon, what words am I putting in your mouth? Lighten up. Nobody's been
bashing screen; it does its job quite well. But if you just want to run,
say, an emacs that you can reconnect to if the connection drops, ``sess
emacs'' is much more efficient than ``screen emacs''. On the flip side
again, screen lets you switch between terminal types, while pty doesn't
grok the first thing about termcap.

---Dan