LinuxQuestions.org

LinuxQuestions.org (/questions/)
-   Linux - Newbie (https://www.linuxquestions.org/questions/linux-newbie-8/)
-   -   what is the powerfull kill command in UNIX (https://www.linuxquestions.org/questions/linux-newbie-8/what-is-the-powerfull-kill-command-in-unix-580354/)

just_a_kid 08-28-2007 04:25 AM

what is the powerfull kill command in UNIX
 
Hi

I have this process that i cannot kill using "kill -9 <pid>"

Any clue how to kill this.

I logged on as super user already.. and it doesnt give me any error message. but this process seem does not go away.


Thanks

jschiwal 08-28-2007 04:27 AM

It is probably in a zombie state. The kernel will get rid of it. Another possibility is that you use selinux and the security settings don't even allow root to kill the process.

By the way, you can use "sudo" instead of logging in as root.

just_a_kid 08-28-2007 04:31 AM

Hi ,

Can teach me how to do that?


Code:

webservd 15484    1  0  Aug 07 ?      248:53 webservd -r /opt/SUNWwbsvr -d /opt/SUNWwbsvr/https-ilssvr3-dev.tpcils.com/confi
This is what i get from ps -ef|grep web

But i cannot kill -9 15484 using root user

jschiwal 08-28-2007 06:13 PM

I'm not at my Linux computer right now, and I'm not sure what the "?" state is for. If memory serves, it is for an "unknown" state that should be temporary. A zombie process will show a state of "Z". You should learn how this service should be shut down properly. For example, on SuSE, I would use an rc script to shut down a service, as in "sudo /usr/sbin/rccups stop" to shut down the cupsd daemon. On other distro's you can use the init.d/ script with a shutdown argument.
If you do need to use the kill command to stop a program, it is better to use either the "-s SIGQUIT" or "-s SIGHUP" signals instead of -s SIGKILL. How is the "webservd" service started. There is probably an /etc/init.d/webservd script that you should use to shut it down.
In your case if the "?" state isn't temporary, you might need to reboot. You may have abruptly killed other services or programs in the past and have orphaned memory that can be freed.

just_a_kid 08-28-2007 08:15 PM

Hi


I think i solved it by restarting the server.

I think i know why this is happening
First i have three processess

I should have killed those processes with SPID = 1 first

jschiwal 08-29-2007 01:02 PM

The process with the PID of 1 will be the init process. You don't want to kill that. You shouldn't be killing processes. You should shut them down the way they are designed to be shut down. Usually via a script command with a "stop" argument. That way it can shut down gracefully, including all of the dependent processes.

Take a look at the "signals" manpage. It lists what signals you can send. Sending the SIGQUIT signal is a more "polite" way of ending processes.


All times are GMT -5. The time now is 07:10 AM.