I forgot about screen.  The trick is that when you run something under screen, its controlling terminal is that of the screen program - screen makes its own controlling terminal by implementing something called a pseudo terminal.

On 10/27/06, Shawn <[EMAIL PROTECTED]> wrote:
(Sorry if it's a duplicate post - it's been 5 minutes and the first
hasn't shown up yet... usually only takes a minute at most...)

I can see a couple ways:

first, while the process is running hit ctrl-z (I think that's right),
which should background the process.  Then switching to your console use
the fg command.  The problem here though is that your bash session in X
is a child of your logged in X session (I think), so is terminated when
X stops.  So I don't think this will work - but I haven't tested it either.


I don't think that this will work.
 

Second, and I *KNOW* this will work - use screen.  You'll probably have
to install it - most distros don't include it.  Once installed, open up
your x-term, and type in "screen".  If it presents you with a command
prompt, it's working.  Start your process, then do "ctrl-A then D" (hope
I remember that right) which will exit the screen session and return you
to your usual prompt.  Close your x-term. The process is still running.
  Then in your console do a "screen -r" which will reconnect to the last
session.  Your console should reflect whatever has been happening with
the process.

This is what I meant by the program would have to be specialy written.  What
screen is doing is opening a shell in the X-term, but the shell gets its
controlling terminal from screen, not from the shell of the X-term.  Screen
would do this by calling setsid to make itself a session leader, creating a
pseudo terminal and then running the program you want to run.  I'm pretty
sure that if you check that the program will be a child of screen, not the
Xterm.

I use the screen command all the time to remotely start long compiles on
the Gentoo server(s) I manage, then come back to them later (like the
next day or two).  This way I can safely shut down the workstation I
started the command from, yet know the processes are working fine.

I've even heard that you can get two screen sessions running in a split
screen type mode in a single console...  But I've never had a need for
that...

I have not needed to do that. Maybe thats why I forgot about screen.


_______________________________________________
clug-talk mailing list
[email protected]
http://clug.ca/mailman/listinfo/clug-talk_clug.ca
Mailing List Guidelines (http://clug.ca/ml_guidelines.php)
**Please remove these lines when replying

Reply via email to