Posts
20
Comments
67
Trackbacks
0
CENTOS 5.6 httpd dead but subsys locked [RESOLVE]

I just finished installing CentOS 5.6 on my machine and when i tried to start httpd service I encountered this error

"httpd dead but subsys locked"

Googling around I foudn this commands

check for running processes

     ipcs -s | grep apache (more info @ http://linux.about.com/library/cmd/blcmdl8_ipcs.htm)

stop processes

     ipcs -s | grep apache |  perl -e 'while (<STDIN>) { @a=split(/\s+/); print `ipcrm sem $a[1]`}'
 

Remove httpd lock file

    cd /var/lock/subsys
    rm httpd

 

restart httpd and check status

Taken from http://blog.linuxvin.com/?p=150


 

posted on Monday, May 16, 2011 8:43 PM Print
Comments
Gravatar
# re: CENTOS 5.6 httpd dead but subsys locked [RESOLVE]
Caio
5/27/2012 11:20 AM
Works fine ! Great !!!
Gravatar
# re: CENTOS 5.6 httpd dead but subsys locked [RESOLVE]
Isa
6/26/2012 4:21 AM
Great help! Thanks!
Gravatar
# re: CENTOS 5.6 httpd dead but subsys locked [RESOLVE]
Surajit Roy
7/14/2012 1:17 AM
Hi i am facing the following error while trying to start httpd

[root@nagiosxi lock]# service httpd start
Starting httpd: (98)Address already in use: make_sock: could not bind to address 0.0.0.0:80
no listening sockets available, shutting down
Unable to open logs
[FAILED]

Then i have killed the process and removed the files called /var/lock/subsys/httpd

[root@nagiosxi lock]# killall -9 httpd
[root@nagiosxi lock]#

[root@nagiosxi lock]# rm -f /var/lock/subsys/httpd
[root@nagiosxi lock]#

Then its started but the status is "httpd dead but subsys locked"
[root@nagiosxi lock]# service httpd start
Starting httpd: [ OK ]

[root@nagiosxi lock]# service httpd status
httpd dead but subsys locked
[root@nagiosxi lock]#

Please help me to resolve the issue.

Thanks
Surajit
Gravatar
# re: CENTOS 5.6 httpd dead but subsys locked [RESOLVE]
ikhmat
5/30/2014 9:30 AM
Thanks man, it works great!!!
Gravatar
# re: CENTOS 5.6 httpd dead but subsys locked [RESOLVE]
Dumbass
8/1/2014 1:16 AM
Thank you man!
Gravatar
# re: CENTOS 5.6 httpd dead but subsys locked [RESOLVE]
Manoj
9/9/2014 2:46 PM
hi,

Am unable to start the snort services. i have done the all above steps, still it is not working. pls help some one to resolve this issue.

[root@GCPLINHYD2NDS01TEST subsys]# rm snort
rm: remove regular empty file `snort'? y
[root@GCPLINHYD2NDS01TEST subsys]# service snort restart
snort: unrecognized service
[root@GCPLINHYD2NDS01TEST subsys]# service snortd restart
Stopping snort: [FAILED]
Starting snort: [FAILED]
Gravatar
# re: CENTOS 5.6 httpd dead but subsys locked [RESOLVE]
Irish
4/25/2015 8:39 AM
thank you so much it works now!
Gravatar
# re: CENTOS 5.6 httpd dead but subsys locked [RESOLVE]
Atul Pawar
1/21/2016 4:28 AM
Excellent fix, resolved in 2 min.
Gravatar
# re: CENTOS 5.6 httpd dead but subsys locked [RESOLVE]
karan
3/23/2016 3:45 AM
While I was starting nrpe service , i was getting "nagios dead but subsys locked"

**Resolution 1: In that case I tried to delete nrpe.pid under /var/run/nrpe and lock file under /var/lock/subsys - But it has not solved my problem
Then I checked the logs under /var/log/messages because nagios was not creating separate log file and observed as below:**

*Mar 23 00:36:48 localhost kernel: readahead-collector: starting delayed service auditd
Mar 23 00:36:49 localhost auditd[1273]: Started dispatcher: /sbin/audispd pid: 1275
Mar 23 00:36:49 localhost audispd: No plugins found, exiting
Mar 23 00:36:49 localhost auditd[1273]: Init complete, auditd 2.0.4 listening for events (startup state enable)
Mar 23 00:36:49 localhost kernel: readahead-collector: sorting
Mar 23 00:36:49 localhost kernel: readahead-collector: finished
Mar 23 00:38:59 localhost nrpe[1349]: Starting up daemon
Mar 23 00:38:59 localhost nrpe[1349]: Cannot write to pidfile '/var/run/nrpe/nrpe.pid' - check your privileges.
Mar 23 00:38:59 localhost nrpe[1349]: Bind to port 5666 on 192.168.137.2 failed: Cannot assign requested address.
Mar 23 00:38:59 localhost nrpe[1349]: Cannot bind to any address.*


**From the log file it was clear that nagios was not able to write .pid , I observed that nrpe directory was deleted accidentally , I created it manually under /var/run
After That, I again restarted nrpe but got same error, I observed the logs again:**

*Mar 23 00:50:26 localhost nrpe[1502]: Starting up daemon
Mar 23 00:50:26 localhost nrpe[1502]: Bind to port 5666 on 192.168.137.2 failed: Cannot assign requested address.
Mar 23 00:50:26 localhost nrpe[1502]: Cannot bind to any address.
Mar 23 00:51:22 localhost nagios: SERVICE ALERT: localhost;HTTP;CRITICAL;HARD;4;connect to address 127.0.0.1 and port 80: Connection refused*


**Solution : Then I opened the /etc/nagios/nrpe.cfg file and changed the server address to nagios client IP as below(By mistake I had mentioned the nagios server address i.e 192.168.137.2):
server_address=192.168.137.3**

**Restarted the nrpe service and it got restarted successfully**

Logs output:
*Mar 23 00:52:13 localhost nrpe[1526]: Starting up daemon
Mar 23 00:52:13 localhost nrpe[1526]: Server listening on 192.168.137.3 port 5666.
Mar 23 00:52:13 localhost nrpe[1526]: Listening for connections on port 0
Mar 23 00:52:13 localhost nrpe[1526]: Allowing connections from: 192.168.137.2*
Gravatar
# re: CENTOS 5.6 httpd dead but subsys locked [RESOLVE]
ram
1/9/2017 1:56 AM
really helpful

Post Comment

Title *
Name *
Email
Comment *  
Verification
Tag Cloud