Re: Detaching processes on VMS

From: Brian Chase (bdc_at_world.std.com)
Date: 01/15/04


Date: Thu, 15 Jan 2004 09:13:36 +0000 (UTC)

In article <LRmNb.8025$Vr7.7892@newssvr22.news.prodigy.com>,
Michael Austin <maustin@no-more-spam.firstdbasource.com> wrote:
> Steve Young wrote:

> > I was wondering if anyone could suggest a tool that would enable me to run
> > detached processes (not in the spawn/detach sense), much like one can do with
> > screen under UNIX. i.e., I start up a process, detach and log out and leave
> > the process running. When I log back in I can re-attach to the process and
> > pick up exactly where I left off.
> >
> > Any ideas?
>
> Using ConsoleWorks allows me to do this on the console, however, only
> one person can use it at a time -- actually, multiple people can connect
> to it, it is still a single session so you end up with dualing keyboards.
>
> A better description of the problem you are trying to solve might be
> warranted...

I'm not sure it's so much a problem as it is a desired feature. The tool
"screen" that Steve is describing is an almost infinitely useful
productivity enhancer and desktop clutter eliminator. I have it on my
short list of indispensable bits of non-standard software that I like to
have on any Unix system I admin. And it's a pretty short list-- the only
other item on it is "wget".

On a Unix system with screen installed, and end-user could do something
like the following:

* Pull up a Unix shell window on your desktop workstation at the office.
* Run the screen program, which presents the user with an new but
  otherwise identical shell prompt within the same window.
* Type Ctrl-A-C, which creates a second shell session, placing the user at
  this new shell.
* Type Ctrl-A-C again, which creates a third shell session, placing the
  user at this new shell.
* Run pine (an text based e-mail client) in the current shell.
* Type Ctrl-A-P to go to the previous (second) shell session.
* Run a "tail -f" command to monitor the web server log.
* Type Ctrl-A-P to go to the first shell session.
* Run nethack or tetris for terminals until bored.
* Type Ctrl-A-2 to take you to the third shell session where you get
  caught up on your mail (the session numbering starts at 0).
* Type Ctrl-A-N to cycle around to your first session again to play a bit
  more nethack.
* Quickly type Ctrl-A-N to cycle to the second session, with the web log
  being monitored, when the boss walks by.
* After the danger has passed, type Ctrl-A-P to get back to playing
  nethack.
* At the end of the work day, type Ctrl-A-D to detach screen and leave it
  running in the background (where it still holds the nethack, log
  monitoring, and pine processes).
* Drive a miserable hour long commute from the office to your home.
* Get on your home computer and dial up to work.
* SSH into your desktop workstation, getting to a shell prompt.
* Type in "screen -r" to reattach your screen processes.
* Play nethack a bit more.
* Type Ctrl-A-2 and check your e-mail under your pine session.
* Type Ctrl-A-D to detach your screen process.
* Logout.
* Sleep.
* Drive a miserable hour long commute to the office from your home.
* Login to your workstation, pull up a shell window, and reattach to
  the screen process.
* lather, rinse, repeat, etc...

And that's really just the basics of what screen offers. Each instance of
screen you run can hold up to 10 sessions, and you can run multiple
instances of screen on a given system, attaching and dettaching to them as
necessary. You can also take snapshots of a given session's text, saving
it to file. You can log a session to file. You can cut-and-paste text
between a screen's sessions. You can lock your screen session when you
walk away from your terminal.

Another way to describe screen is that it's a software version of
something like a multi-session VT420 terminal, with the exception of
screen being a magnitude or two more useful and flexible than its physical
counterpart. That ability to detach from the screen sessions and then
later login and reattach to them from some completely different location
is immensely useful, even without screen's multi-session support.

So, as an example, let us say that I've just run the edit command on my
VMS system. Is there some way that I can either "background" (in the Unix
sense) this edit or barring that, is there a way that I can logout while
still, somehow, leaving my edit session running on the VMS system? And is
it then possible to reattach to that session at some later time, to pick
up where I left off?

TOPS-10 supported this behavior with the 'detach', 'attach', and
'reattach' commands, so the concept has been around for rather a long
while. Certainly the original designers of VMS would've been aware of it.
The VMS attach command looks promising, but it's not clear how or if
there's a way to explicitly detach a VMS process.

-brian.

-- 
--- Brian Chase | bdc@world.std.com | http://world.std.com/~bdc/ -----
                   Do not fold, mutilate, or spindle.


Relevant Pages

  • Re: SIGHUP and Session leaders (was Re: Start scripts under linux)
    ... Set the variables in your shell equally. ... And note who is the session ... Why doesn't my process get SIGHUP when its parent dies? ... and one or more processes in the orphaned group are ...
    (comp.os.linux.setup)
  • Re: Detaching processes on VMS
    ... it is still a single session so you end up with dualing keyboards. ... >* Pull up a Unix shell window on your desktop workstation at the office. ... >* Run nethack or tetris for terminals until bored. ... Certainly the original designers of VMS would've been aware of it. ...
    (comp.os.vms)
  • Re: [opensuse] BASH .bashrc su question
    ... go back to the non-root shell from which it was invoked. ... shift+rt or shift+lt arrows to move between screens. ... The beauty of screen is that you can open a session in a konsole window on your desktop at work, and then from home ssh to your work PC, and detatch the screen session from your work desktop and have it appear on your home konsole window. ...
    (SuSE)
  • Re: [opensuse] BASH .bashrc su question
    ... go back to the non-root shell from which it was invoked. ... what the advantage would be over multiple tabs in konsole and using ... shift+rt or shift+lt arrows to move between screens. ... The beauty of screen is that you can open a session in a konsole window on ...
    (SuSE)