BASH Process termination

BASH Process termination

Post by Tae-Yeoub Jan » Fri, 06 Nov 1998 04:00:00



I have a BASH script which contains two separate processes: process_A,
process_B.  Process_A runs in the background and Process_B supplies
a series of data for Process_A.  

Now the problem is: After I quit the process_A, the process_B is still
alive and keeps working until all the data is exhausted.  What I want
is: when I kill process_A, the process_B also dies and the shell
script terminates totally.  The point is: how can I detect the end of
process_A and make it known to process_B as well.  I couldn't work it
out with the command 'trap' because the termination of process_A is
not done by 'signal' but by the internal 'quit' device of process_A.

Thanks for any ideas.
Tae.

 
 
 

BASH Process termination

Post by Donn Ca » Fri, 06 Nov 1998 04:00:00


| I have a BASH script which contains two separate processes: process_A,
| process_B.  Process_A runs in the background and Process_B supplies
| a series of data for Process_A.  

| Now the problem is: After I quit the process_A, the process_B is still
| alive and keeps working until all the data is exhausted.  What I want
| is: when I kill process_A, the process_B also dies and the shell
| script terminates totally.  The point is: how can I detect the end of
| process_A and make it known to process_B as well.  I couldn't work it
| out with the command 'trap' because the termination of process_A is
| not done by 'signal' but by the internal 'quit' device of process_A.

It sounds like you could make note of the background process' ID and
send a signal from the script:

   process_B &
   ID_B=$!
   process_A
   kill -1 $ID_B

        Donn Cave, University Computing Services, University of Washington


 
 
 

1. BASH BASH BASH BASH BASH BASH BASH BASH BASH BASH

Is there a proper fixed bash on any of the FTP sites out there?

I know there bash is on the usual sites but I don't know if they are
bugged or not :(

Regards,

Neil.

--


------------------------------------| Edinburgh, EH14 2DE, United Kingdom
**Domino: There`s nothing you can do when you`re the next in line: Domino**

2. setting forcedirectio

3. co-processes and bash (ksh does it, can bash?)

4. How do it synchronize my system clock with an atomic clock ?

5. process number of current process..BASH

6. character encrypting

7. Q: Notify device driver about process termination

8. PPP problems

9. blocked process resists termination

10. How do I suppress bkg. process termination messages?

11. signal of begining and termination of a runing process

12. Catching termination of child process and system() call

13. Driver driver peculiarity on process termination