waiting on a sub-sub process

waiting on a sub-sub process

Post by David Zempe » Sun, 04 Feb 2001 04:22:54



Short of watching for a PID to disappear within a loop, is there a good
way of waiting for a subprocess of a subprocess? Unix wait only works on
immediate subprocesses.

Thanks, Dave.

 
 
 

waiting on a sub-sub process

Post by brian hile » Sun, 04 Feb 2001 04:39:12



> Short of watching for a PID to disappear within a loop, is there a good
> way of waiting for a subprocess of a subprocess? Unix wait only works on
> immediate subprocesses.
> Thanks, Dave.

wait <PID-of-sub-sub-process>

Of course, it has to be within the same process group as the script.

-Brian

 
 
 

waiting on a sub-sub process

Post by David Zempe » Sun, 04 Feb 2001 04:56:58


If I execute the following series of commands, the final "wait" doesn't
wait for the PID of the "top" process.  It immediatly returns.

xterm -e top&
ps -ef|grep top

#this returns two processes, one for the xterm (the immediate sub
process)
#and one for "top"

wait top_pid  #where top_pid is the pid of the "top" process

Am I not using wait properly?

Thanks, Dave.

 
 
 

waiting on a sub-sub process

Post by <scott.walkins.. » Sun, 04 Feb 2001 17:37:25


no David, you're quite right - the shell will only wait for a process it can
recieve signals from - there is no pipe from a "sub-sub" process to the
original shell. It is up to the parent process, in your case the xterm, to
handle signals from top, and the shell script to handle signals from xterm.
Not sure what version of unix or what shell you're using but the wait
command will prob be returning immediately with an error because it realises
top's PID is one it is unable to wait for to finish.

Not sure why you would want to do this tho - why would you want to call a
program that calls another program, but only be interested when the second
program terminates? Why not just call the second program from the shell? -
can you elaborate?

Cheers,
S.


Quote:> If I execute the following series of commands, the final "wait" doesn't
> wait for the PID of the "top" process.  It immediatly returns.

> xterm -e top&
> ps -ef|grep top

> #this returns two processes, one for the xterm (the immediate sub
> process)
> #and one for "top"

> wait top_pid  #where top_pid is the pid of the "top" process

> Am I not using wait properly?

> Thanks, Dave.

 
 
 

1. Sub-sub-sub-sub-sub subdomains?

No, it's not a typo.

My question is quite simple: I've read on how to set up subdomains on
apache using the wildcard mask, but what about subdomains several
levels deep?

Do I need to create one DNS entry for every "subdomain level" so to
speak?.

Lets say I currently have... whatever... "cool.com" (then I'd sell it
;-). No I mean... lets pretend I have something like "cool.com". With
"traditional" apache wildcard subdomains setup and the right entries
on bind, I can have "anything.cool.com" "a.cool.com" "b.cool.com", etc
all pointing to the same web page.

But what if I want to do a hostname in the form
"http://This.bind.is.really.cool.com"? That's 4 levels of
subdomains.

Can someone explain me how to setup something like this, both form the
apache and bind sides??

Regards
Willy
PS: I'm posting this same question to the bind newsgroup since this
involves setting up correctly both daemons.

2. svgalib problems

3. How to Kill Process and Its sub-process and its sub-process??

4. Ibill scripts (URGENT)

5. How to Kill a process and its sub-process and its sub-process at a time..

6. SCSI Card for Linux ?

7. NIS+ Sub-Domain client: should it be a member of the master domain AND sub-domain?

8. dhcp lan ; Fedora without ifconfig

9. cdrom.com: slack 7/next/sub/sub.next...?

10. Home sub dir of it's own sub?

11. How do I wait on sub shells

12. Killing Sub-Processes?

13. I/O to sub processes - HELP