killing a shell script is not killing child processes

killing a shell script is not killing child processes

Post by Sriniv » Wed, 20 Nov 2002 12:40:24



dispatcher (NOHUP mode)->daemon->shell script (parent
PID)->executables(child PIDs)

When we try to kill shell script (parent PID) with kill-9 command, I
am expecting that all executables (child PIDs) that are running from
shell script should also be killed.

Shell script process is getting killed but not the child processes.

I tried read all the messages patiently but it added up more
confusions.

I found a way to kill all child processes before killing parent shell
script but trying to find a answer for this behaviour.

Any expert responses are welcome.

Cheers,
Srinivas

 
 
 

killing a shell script is not killing child processes

Post by those who know me have no need of my nam » Wed, 20 Nov 2002 14:52:21


[fu-t set]

in comp.unix.internals i read:

Quote:>dispatcher (NOHUP mode)->daemon->shell script (parent
>PID)->executables(child PIDs)

>When we try to kill shell script (parent PID) with kill-9 command, I
>am expecting that all executables (child PIDs) that are running from
>shell script should also be killed.

>Shell script process is getting killed but not the child processes.

a) kill -9 is evil.  do not use it except in *extreme* duress.

b) you have to signal the process group in order for the members to receive
the signal, otherwise you are only signaling one process.  the pgid is the
negative of the pid of the process group leader.

--
bringing you boring signatures for 17 years