LinuxQuestions.org
Share your knowledge at the LQ Wiki.
Home Forums Tutorials Articles Register
Go Back   LinuxQuestions.org > Forums > Other *NIX Forums > Solaris / OpenSolaris
User Name
Password
Solaris / OpenSolaris This forum is for the discussion of Solaris, OpenSolaris, OpenIndiana, and illumos.
General Sun, SunOS and Sparc related questions also go here. Any Solaris fork or distribution is welcome.

Notices


Reply
  Search this Thread
Old 11-29-2010, 08:04 PM   #1
romeo_tango
Member
 
Registered: Nov 2006
Distribution: Mint
Posts: 148

Rep: Reputation: 15
Question Can't Kill HTTPD Process


Hi,

I have a problem with httpd. This already occured twice actually.

When I tried to restart the service, it seems that the parent got killed in the stop process but it won't restarted again and left tons of child processes.

I tried to grep the PIDs and killed all in once using :
Code:
ps -fe | grep http | awk '{print $2}' | xargs kill -9
but failed.

In other words, why couldn't I kill -9 these PIDs? These are not even zombies. I checked using 'top' command and it showed

Code:
682 processes: 680 sleeping[
no zombies at all.

Please help me how to get rid of these unkilled process.

Thanks.
 
Old 11-30-2010, 12:01 AM   #2
kbp
Senior Member
 
Registered: Aug 2009
Posts: 3,790

Rep: Reputation: 653Reputation: 653Reputation: 653Reputation: 653Reputation: 653Reputation: 653
'pkill -9 httpd' is a little shorter .. usually processes that don't respond to signals are in uninterruptible sleep ('D' in top output), they may be waiting for IO

hth
 
Old 11-30-2010, 12:03 AM   #3
romeo_tango
Member
 
Registered: Nov 2006
Distribution: Mint
Posts: 148

Original Poster
Rep: Reputation: 15
Quote:
Originally Posted by kbp View Post
'pkill -9 httpd' is a little shorter .. usually processes that don't respond to signals are in uninterruptible sleep ('D' in top output), they may be waiting for IO

hth
But the case here is that the httpd processes don't have any parent ID and can't be killed.

What should I do instead of rebooting? Have anyone encountered this issue before?

Thanks
 
Old 11-30-2010, 12:18 AM   #4
kbp
Senior Member
 
Registered: Aug 2009
Posts: 3,790

Rep: Reputation: 653Reputation: 653Reputation: 653Reputation: 653Reputation: 653Reputation: 653
Child processes that are orphaned ( their parent is deceased ) usually have their parent set to init, please post a sample of 'ps -ef'
 
Old 11-30-2010, 12:43 AM   #5
romeo_tango
Member
 
Registered: Nov 2006
Distribution: Mint
Posts: 148

Original Poster
Rep: Reputation: 15
Sorry since this is very long I'll just put it here

Code:
http://pastebin.com/cjhE3DAr
Thanks.
 
Old 11-30-2010, 04:33 PM   #6
kbp
Senior Member
 
Registered: Aug 2009
Posts: 3,790

Rep: Reputation: 653Reputation: 653Reputation: 653Reputation: 653Reputation: 653Reputation: 653
Thanks but I can't see the whole command line, could you please use 'ps -wwef | grep http' ?

If I was to guess, it looks like these are hanging around from a 'httpd -k start' or 'httpd -k restart' - how are you controlling the daemon, init script ?
 
Old 11-30-2010, 08:59 PM   #7
romeo_tango
Member
 
Registered: Nov 2006
Distribution: Mint
Posts: 148

Original Poster
Rep: Reputation: 15
Quote:
Originally Posted by kbp View Post
Thanks but I can't see the whole command line, could you please use 'ps -wwef | grep http' ?
The server was already rebooted and back to normal so I don't think if I run the command now would give some hint to you

Quote:
If I was to guess, it looks like these are hanging around from a 'httpd -k start' or 'httpd -k restart' - how are you controlling the daemon, init script ?
That's right. I did 'httpd -k restart' yesterday perhaps twice or thrice because the http wasn't accessible. I thought it was dead, but it wasn't.

The thing is.. I always do the same thing, same treatment and same command in other Sun servers and never encountered this issue before in other words, never met a process that can't be killed using 'kill -9'
 
Old 12-01-2010, 02:20 AM   #8
jlliagre
Moderator
 
Registered: Feb 2004
Location: Outside Paris
Distribution: Solaris 11.4, Oracle Linux, Mint, Debian/WSL
Posts: 9,789

Rep: Reputation: 492Reputation: 492Reputation: 492Reputation: 492Reputation: 492
A process that can't be killed by "-9" has a system call pending that doesn't return for some odd reason.
 
Old 12-01-2010, 02:25 AM   #9
romeo_tango
Member
 
Registered: Nov 2006
Distribution: Mint
Posts: 148

Original Poster
Rep: Reputation: 15
Quote:
Originally Posted by jlliagre View Post
A process that can't be killed by "-9" has a system call pending that doesn't return for some odd reason.
So what should I do with those kind of processes other than rebooting?

Thanks.
 
Old 12-01-2010, 03:46 AM   #10
jlliagre
Moderator
 
Registered: Feb 2004
Location: Outside Paris
Distribution: Solaris 11.4, Oracle Linux, Mint, Debian/WSL
Posts: 9,789

Rep: Reputation: 492Reputation: 492Reputation: 492Reputation: 492Reputation: 492
Take measures for the system call to end which might be possible or not depending on what system call it is.
 
Old 12-16-2010, 07:06 PM   #11
ADxD_7
Member
 
Registered: May 2007
Location: CO
Distribution: Solaris , Redhat , Debian
Posts: 152

Rep: Reputation: 23
Another thing it may be is that that SMF is controlling apache - I had this issue awhile back, I tried to use the apachectl command to stop httpd and it would not die, I also tried using kill -9, it was because the service was being controlled by SMF so you may do a quick svcs -a | grep -i apache - and see if it is in there cause it will restart it over and over and over if you kill -9 it or whatever you do to it...
 
Old 01-03-2011, 03:16 AM   #12
romeo_tango
Member
 
Registered: Nov 2006
Distribution: Mint
Posts: 148

Original Poster
Rep: Reputation: 15
Hi.. thank you for the reply.

I did svcs -a and found these lines :

Code:
legacy_run     Dec_13   lrc:/etc/rc3_d/S50apache
maintenance    Dec_13   svc:/network/http:apache2
Right now the Apache status is working just fine. But I don't understand what's the difference between those two lines.

I usually started the apache manually by running httpd -k start.

Is it bad?
 
Old 01-03-2011, 04:14 AM   #13
jlliagre
Moderator
 
Registered: Feb 2004
Location: Outside Paris
Distribution: Solaris 11.4, Oracle Linux, Mint, Debian/WSL
Posts: 9,789

Rep: Reputation: 492Reputation: 492Reputation: 492Reputation: 492Reputation: 492
The first line apply to apache 1.2 and the second one to apache 2.x. Both are installed on your machine. 1.2 is launched through rc scripts, 2.x is managed by smf, and is reported in maintenance mode, i.e. not functioning properly.
 
Old 01-03-2011, 04:29 AM   #14
romeo_tango
Member
 
Registered: Nov 2006
Distribution: Mint
Posts: 148

Original Poster
Rep: Reputation: 15
Quote:
Originally Posted by jlliagre View Post
The first line apply to apache 1.2 and the second one to apache 2.x. Both are installed on your machine. 1.2 is launched through rc scripts, 2.x is managed by smf, and is reported in maintenance mode, i.e. not functioning properly.
okay.. that is strange because right now the httpd is running well and I am using Apache 2.
How to find out what went wrong? I don't find any errors in /var/adm/messages nor in apache logs.
 
Old 01-03-2011, 06:14 AM   #15
jlliagre
Moderator
 
Registered: Feb 2004
Location: Outside Paris
Distribution: Solaris 11.4, Oracle Linux, Mint, Debian/WSL
Posts: 9,789

Rep: Reputation: 492Reputation: 492Reputation: 492Reputation: 492Reputation: 492
Code:
svcs -xv http:apache2
should point you to relevant log files.
 
  


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
Can a child process kill the parent process ? sree_ec Programming 8 11-20-2010 05:37 AM
bash `kill`: process 'B' silently dies; but process 'A' = `kill` spews back debris! GrapefruiTgirl Programming 9 06-23-2009 09:42 AM
How to get the PID of the process giving kill signal to a process? hariprd Programming 2 11-27-2008 03:10 AM
Shell Script : Kill a running process when another process starts ashmew2 Linux - General 3 08-20-2008 03:47 AM
cannot kill process (kill -9 does not work) mazer13a Linux - General 1 05-27-2005 02:32 PM

LinuxQuestions.org > Forums > Other *NIX Forums > Solaris / OpenSolaris

All times are GMT -5. The time now is 07:49 PM.

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