[plug] Can I restart a suspended job on a remote machine from a different shell?
Russell Steicke
r.steicke at bom.gov.au
Fri Mar 18 19:01:38 WST 2005
On Fri, Mar 18, 2005 at 06:31:30PM +0800, William Kenworthy wrote:
> It did work - when I got home the output was on screen, but needed a
> couple of jabs at the enter key to get the prompt back. I'll have a
> look at your script later and see if that will do what I want (for next
> time!)
I had a look, and it's more than a script. It's quite a hack, in the
best sense of the word.
> On Fri, 2005-03-18 at 16:21 +0800, Bernard Blackham wrote:
> > On Fri, Mar 18, 2005 at 03:46:56PM +0800, Russell Steicke wrote:
> > > On Fri, Mar 18, 2005 at 03:16:07PM +0800, W.Kenworthy wrote:
> ...
> >
> > The only problem with this is that either the shell will get a
> > little confused, as it'll still be the shell marked as the
> > controlling process of the tty (the shell won't be aware the the
> > process is now foregrounded), or the process will try to write to
> > standard output, find out it's not the controlling process of the
> > tty, and be sent a SIGTTOU and stop.
Yes, that seems right, and if I'm reading APUE[0] correctly, it
confirms that things should happen like that, but they don't. The
stopped processes continue on and write to the tty, even though
they're in a different process group.
The shell doesn't seem to get confused, either. I'm not sure what's
happening here, but it does work. I tried both xterms and linux
consoles and they both work.
> > If you're daring, you could try an experimental tty stealer that I
> > wrote a while back - http://dagobah.ucc.asn.au/things/grab.c - it
> > lets you catch the ttys of a currently running process to your
> > current tty (for example, into a screen) ... I've been meaning to
> > improve it never got around to it.
> >
> > Bernard.
[0] Advanced Programming in the Unix Environment.
--
Russell Steicke
-- Fortune says:
A young girl once committed suicide because her mother refused her a new
bonnet. Coroner's verdict: "Death from excessive spunk."
-- Sacramento Daily Union, September 13, 1860
More information about the plug
mailing list