Operating System - HP-UX
1821255 Members
3159 Online
109632 Solutions
New Discussion юеВ

Killing daemon processes having pid not equal to 1

 
SOLVED
Go to solution
Shivkumar
Super Advisor

Killing daemon processes having pid not equal to 1

Dear Sirs;

I just read sometime back on this forum that if daemon with a pid number 1 is hung; it can't be killed by "kill -9" command.
I assume that any daemon processes which doesn't have pid 1 can be killed.

Please let me know whether my assumption is correct.

Thanks,
Shiv
4 REPLIES 4
Patrick Wallek
Honored Contributor
Solution

Re: Killing daemon processes having pid not equal to 1

Well, no, not necessarily. Whether or not a process can be killed depends in its state and priority.

If a process is waiting on I/O, then it is not kill-able.

An example -- You have a single disk with a VG/LV/filesystem on it. The disk goes completely bad. Anything you do that references that Disk/VG/LV/filesystem will likely hang because it is waiting on I/O from the disk, which isn't going to happen because the disk is dead. If you tried to kill those processes, you wouldn't be able to because they are waiting on I/O.

The PPID (Parent Process ID), which is what I think you meant rather than the PID (Process ID), really doesn't determine if something can be killed.

I think what you actually read was talking about Zombie processes (processes whose parent has gone away causing the PPID to become 1). Zombies cannot be killed (THEY'RE ALREADY DEAD!).

However, not all hung processes are zombies.

A. Clay Stephenson
Acclaimed Contributor

Re: Killing daemon processes having pid not equal to 1

Whether or not it's safe to kill (actually signal) a daemon or any other process really has nothing to do with whether or not its PPID is 1. For example, you could completely wipe out a database instance by killing one of the daemons --- and possibly corrupt data in the process. For that matter, it's not all that easy to identify a daemon partly because there is no strict definition and because there is no strict naming convention although most end with 'd'.

Whether or not a process can respond to any signal (even kill -9) depends upon the events upon which the process is waiting. For example, if a process is waiting on a higher priority event (e.g. i/o) then you can kill -9 it forever and the process will not respond.
If it ain't broke, I can fix that.
morganelan
Trusted Contributor

Re: Killing daemon processes having pid not equal to 1

We can not kill certain process even if using kill -9, for example if we execute who -T command and have found 'the elapsed time since input activity occurred on the line' is said old and then we can not kill this session.If we force to kill with -9, it will report that The specified process does not exist.
Kamal Mirdad
Arunvijai_4
Honored Contributor

Re: Killing daemon processes having pid not equal to 1

Init has got PID of 1, and it is grand father of all other processes in an OS. I assume, you mean to say "Any daemon processes which doesn't have PPID 1 can be killed". Nope, if Process A forks process B, A's PID will be PPID of B. Killing A unnecessarily make process B as Orphan. So, it is better to leave as it is.

-Arun
"A ship in the harbor is safe, but that is not what ships are built for"