[comp.unix.questions] How can I adopt a process

pantages@bwdls58.UUCP (Paul Pantages) (01/28/91)

Is it possible to place a running program (in csh or sh, I don't care) in 
the background, or suspend it somehow, and then adopt this program from 
another shell?  In particular, I would like to rlogin from another physical
location and adopt the program I left running. I have read the man  pages on
csh wrt "jobs", but I have been unable to get it to work. Note that I want to
do the "adoption" from a *different* login session.

Btw, I am using HPUX 6.5 on an HP9000. Please email any responses to 

                          pantages@bnr.ca

Thanks, in advance, (even if you tell me that it is impossible)
-- 
Paul Pantages, a 'Westerner'                |`only the strong survive...'   |
     living in exile in eastern Canada, at  |                               | 
bitnet: pantages@bnr.ca, or                 |--BNR will disavow any         | 
 ......uunet!bnrgate!bwdls58!pantages       |    knowledge of my actions... |

frechett@spot.Colorado.EDU (-=Runaway Daemon=-) (01/28/91)

In article <5467@bwdls58.UUCP> pantages@bwdls58.UUCP (Paul Pantages) writes:
=+Is it possible to place a running program (in csh or sh, I don't care) in 
=+the background, or suspend it somehow, and then adopt this program from 
=+another shell?  In particular, I would like to rlogin from another physical
=+location and adopt the program I left running. I have read the man  pages on
=+csh wrt "jobs", but I have been unable to get it to work. Note that I want to
The man pages are useless. Or maybe you can say that they definately get across
the point that it seems impossible.  There is a way.
=+do the "adoption" from a *different* login session.
=+
=+Btw, I am using HPUX 6.5 on an HP9000. Please email any responses to 
=+
=+                          pantages@bnr.ca
=+
=+Thanks, in advance, (even if you tell me that it is impossible)
It isn't.. It is called "screen" It will allow you to open a process (like csh
or sh or any other shell) and do anything you want in it, and whenever you 
want you can detach the whole session and log out.  When you log back in on 
another terminal you can simply resume screen and continue where you left off
OR it can even continue doing whatever it was doing while you are away.  
This will do it for you.  
I should mention that it will also allow you to open MANY windows within screen
and do many different things at once and switch between them at will.  YOu can
detach the whole session with all the windows also.  Our machines go down 
once a week but I have screen running the whole week.  I start it up 
Saturday at noon and that base process runs all week until Friday night. I
always have at least 7 windows open.  
	It accomplishes this all with the help of ptys (psuedo ttys) and is by
far one of the most useful UNIX applications I have ever found.  If you are
worried about your terminal, let me tell you that I have a vt100 terminal and a
modem.  ;)  
	It is currently available from spot.colorado.edu as
daemon/screen23-7.tar.Z. I am going to move it to wuarchive.wustl.edu as soon
as I can so as to reduce load on this machine, so please look for it there 
before you ftp spot.  (This is a message for the REST of you)
It should work on an HP9000.  The only systems that I have seen it really 
choke on is SysV.  If you have SysV you are SOL.  
=+-- 
=+Paul Pantages, a 'Westerner'                |`only the strong survive...'   |
=+     living in exile in eastern Canada, at  |                               | 
=+bitnet: pantages@bnr.ca, or                 |--BNR will disavow any         | 
=+ ......uunet!bnrgate!bwdls58!pantages       |    knowledge of my actions... |

Now for emy question, in the same thread.  I have a friend who can't run screen
as he has a dumbterminal.  All he wants to do is be able to start a process 
and put it in the background.  The problem is that it is a normally interactive
program.  He doesn't need to interact with it however.  Is there some way to 
fool an interactive process into thinking that it is recieving input?  
This is on a DEC 5500 running Ultrix 4.1.
Thanks for any help you can provide.

	ian

--

-=Runaway Daemon=-