home *** CD-ROM | disk | FTP | other *** search
- Xref: sparky comp.unix.questions:10438 comp.unix.shell:3661
- Newsgroups: comp.unix.questions,comp.unix.shell
- Path: sparky!uunet!usc!cs.utexas.edu!hermes.chpc.utexas.edu!news.utdallas.edu!corpgate!crchh327!crchh451!herrage
- From: herrage@crchh451.bnr.ca (Robert Herrage)
- Subject: Killing Offspring
- Message-ID: <1992Aug27.160525.21166@bnr.ca>
- Sender: news@bnr.ca (News on crchh327)
- Nntp-Posting-Host: crchh451
- Reply-To: herrage@bnr.ca
- Organization: BNR
- Date: Thu, 27 Aug 1992 16:05:25 GMT
- Lines: 15
-
- I have a parent process that forks a child process (C1). C1, in turn, forks
- a grandchild process (GC1) which calls "system()" to execute a shell-script.
-
- While the shell-script is running, the parent process can fork another child
- process (C2) whose job is to abort whatever GC1 is doing. All processes have
- access to each others PIDs via shared memory.
-
- When C2 uses kill() to terminate GC1, GC1 becomes <defunc> and the shell-
- script keeps on executing.
-
- Is there a way that I can terminate the shell-script too without C2 having
- to call "system()" with some fancy "ps" command to obtain the PID of the
- shell-script?
-
- Any help would be appreciated.
-