Operating System - HP-UX
1833024 Members
2473 Online
110049 Solutions
New Discussion

killing a process which has Processor utilization for scheduling

 
sushant keerti
Advisor

killing a process which has Processor utilization for scheduling

Hi All,
I am trying to kill a number of processes using kill command.
Below is the ps -eaf of the processes I want to kill.
Here you can see that the second proecess i.e pid = 20410, is the parent for all other processes. And also it has cpu(Processor utilization for scheduling) as 1 ( column 4)

misjit 20424 20410 0 04:31:43
misjit 20410 1 1 04:31:41
misjit 20423 20410 0 04:31:43
misjit 20433 20410 0 04:31:43
misjit 20430 20410 0 04:31:43
misjit 20435 20410 0 04:31:43
misjit 20434 20410 0 04:31:43
misjit 20427 20410 0 04:31:43
misjit 20413 20410 0 04:31:41
misjit 20432 20410 0 04:31:43

So, if I kill parent process, then all chld process should be killed.
When I try the command "kill 20410", The processes are NOT getting killed( The cpu column is changing to 0). But second time I try the same command "kill 20410", all the processes getting killed !.
Can anybody explain me why?..
3 REPLIES 3
OFC_EDM
Respected Contributor

Re: killing a process which has Processor utilization for scheduling

I don't know why that behaviour occurs.

But I've always been told to kill the child processes before killing the parent. To avoid Zombies...this sounds like some Halloween them...killing/zombies :)

So I just line all the child processes up beside the kill command

kill 20424 20423 20433 etc.

Then kill the parent

kill 20410

That's always worked for me 99%. But this opens another question along with your original....is the way I mentioned the correct way? Is there a better way?

Cheers

Note: My method above doesn't always work as the parent might spawn new child processes.

In that scenario I just put the process ID of the parent last in the kill command beside the child process ID's (I've always assume it kills the processes in order from left to right...a bad assumption????)
The Devil is in the detail.
Vivek Bhatia
Trusted Contributor

Re: killing a process which has Processor utilization for scheduling

Hi Sushant,

Okay answer some of the questions?

1. Are you facing any performance issues on this server?

2. If yes paste the output for TOP,glance , sar,swapinfo -tam?

3. if you have kmeminfo script then please use it and let me know the output?

4. Do you suspect any application issues on this server?

Regards,
Vivek Bhatia
Dennis Handly
Acclaimed Contributor

Re: killing a process which has Processor utilization for scheduling

>Here you can see that the second process i.e pid = 20410

No we can't. :-) That's why you need to use this command to see a hierarchical listing:
UNIX95=EXTENDED_PS ps -Hfu misjit

>if I kill parent process, then all child process should be killed.

No, they usually are adopted by init as orphans.

>Kevin: But I've always been told to kill the child processes before killing the parent.

Yes. Also kill them at the same time so the parent doesn't make more.

>To avoid Zombies...this sounds like some Halloween them...killing/zombies :)

These aren't zombies, these are orphans, parent is init.
But you forgot to mention zombie masters, since you can't kill zombies. :-)

>In that scenario I just put the process ID of the parent last in the kill command ... (I've always assume it kills the processes in order from left to right.)

That's what I do. Copy from bottom up.