LinuxQuestions.org
Help answer threads with 0 replies.
Home Forums Tutorials Articles Register
Go Back   LinuxQuestions.org > Forums > Linux Forums > Linux - Newbie
User Name
Password
Linux - Newbie This Linux forum is for members that are new to Linux.
Just starting out and have a question? If it is not in the man pages or the how-to's this is the place!

Notices


Reply
  Search this Thread
Old 08-28-2007, 04:25 AM   #1
just_a_kid
LQ Newbie
 
Registered: Dec 2006
Posts: 24

Rep: Reputation: 15
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
 
Old 08-28-2007, 04:27 AM   #2
jschiwal
LQ Guru
 
Registered: Aug 2001
Location: Fargo, ND
Distribution: SuSE AMD64
Posts: 15,733

Rep: Reputation: 682Reputation: 682Reputation: 682Reputation: 682Reputation: 682Reputation: 682
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.
 
Old 08-28-2007, 04:31 AM   #3
just_a_kid
LQ Newbie
 
Registered: Dec 2006
Posts: 24

Original Poster
Rep: Reputation: 15
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
 
Old 08-28-2007, 06:13 PM   #4
jschiwal
LQ Guru
 
Registered: Aug 2001
Location: Fargo, ND
Distribution: SuSE AMD64
Posts: 15,733

Rep: Reputation: 682Reputation: 682Reputation: 682Reputation: 682Reputation: 682Reputation: 682
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.
 
Old 08-28-2007, 08:15 PM   #5
just_a_kid
LQ Newbie
 
Registered: Dec 2006
Posts: 24

Original Poster
Rep: Reputation: 15
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
 
Old 08-29-2007, 01:02 PM   #6
jschiwal
LQ Guru
 
Registered: Aug 2001
Location: Fargo, ND
Distribution: SuSE AMD64
Posts: 15,733

Rep: Reputation: 682Reputation: 682Reputation: 682Reputation: 682Reputation: 682Reputation: 682
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.
 
  


Reply



Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is Off
HTML code is Off



Similar Threads
Thread Thread Starter Forum Replies Last Post
kill command micro_xii Linux - Newbie 4 11-24-2006 08:48 AM
Question about Kill command bjdea1 Linux - General 2 11-07-2005 10:28 AM
Kill command could not kill Kanaflloric Linux - General 11 08-22-2005 07:18 AM
The kill command tearinox Linux - Newbie 2 08-15-2003 04:40 PM
kill command... Sonny Linux - Newbie 2 01-28-2002 03:08 AM

LinuxQuestions.org > Forums > Linux Forums > Linux - Newbie

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

Main Menu
Advertisement
My LQ
Write for LQ
LinuxQuestions.org is looking for people interested in writing Editorials, Articles, Reviews, and more. If you'd like to contribute content, let us know.
Main Menu
Syndicate
RSS1  Latest Threads
RSS1  LQ News
Twitter: @linuxquestions
Open Source Consulting | Domain Registration