Apache-httpd dead but subsys locked

发布于 2017-01-18 12:03:34 字数 71 浏览 1270 评论 1

这个错误 httpd dead but subsys locked

有谁知道代表什么么,我没找到,求大神恢复啊

如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。

扫码二维码加入Web技术交流群

发布评论

需要 登录 才能够评论, 你可以免费 注册 一个本站的账号。

评论(1

晚风撩人 2017-05-19 03:07:38

找了很长时间,也就是这个地方最全些 XXX

While I was improving my LAMP module I ran in to a problem with Apache 2.2.15 on CentOS 6.2.
Apache wasn’t working with my new module so I decided to install it normally via yum and see what’s going on.
Got it installed just fine with:
yum install httpd

Ran sudo service httpd restart.
All went fine.

But now when I checked status:

service httpd status
httpd dead but subsys locked

Tried to delete the lock:
sudo rm -f /var/lock/subsys/httpd

Didn’t help. It’s still giving the same lock message. The Apache actually works as it’s serving my web pages but the service status is not working as it should. And this is a problem with my Puppet LAMP module.

UPDATE: As pointed out in the comments, here’s another related error message that you might get when you try to restart httpd:

service httpd restart
Stopping httpd: [FAILED]
Starting httpd: (98)Address already in use: make_sock: could not bind to address 10.10.26.11:80
no listening sockets available, shutting down
Unable to open logs
[FAILED]

I have also tried rebooting the box and updating packages with yum update but didn’t help.

I started examining httpd.conf and noticed that the PidFile variable was set to run/httpd.pid by default.
Changed it to point to /var/run:

PidFile /var/run/httpd.pid

And also changed the variable in /etc/sysconfig/httpd:

PIDFILE=/var/run/httpd.pid

Killed the httpd processes:
killall -9 httpd

Removed the lock:
sudo rm -f /var/lock/subsys/httpd

Restarted apache:
sudo service httpd restart

And now it works:

service httpd status
httpd (pid 14331) is running...

Now I wanted to test this again to confirm that this solution works so I restored my virtualbox snapshot from the time when apache was not installed on the CentOS. Installed it again same way with yum. Checked httpd status and it was stopped. Restarted the httpd service and it went OK. Checked the status now presuming that it would complain about the lock again:
httpd (pid 13298) is running…

It’s working!?!

It was the exact same setup when it was complaining about that lock. But now it worked right away. No idea what’s going on here.
Well as that didn’t confirm anything I had to try again:

Restored the VM snapshot. This is CentOS 6.2, installed on virtualbox from liveCD. Firewall disabled, sshd enabled.
Installed apache:
sudo yum install -y httpd

Status check:

service httpd status
httpd is stopped

Started apache:

sudo service httpd start
Starting httpd: [ OK ]

Status check:

service httpd status
httpd dead but subsys locked

Changed the pidfile variable in /etc/httpd/conf/httpd.conf from this:

PidFile run/httpd.pid

To this:

PidFile /var/run/httpd.pid

Changed the pidfile variable in /etc/sysconfig/httpd from this:

#PIDFILE=/var/run/httpd/httpd.pid

To this:

PIDFILE=/var/run/httpd.pid

Killed httpd processes:
killall -9 httpd

Removed any httpd locks:
sudo rm -f /var/lock/subsys/httpd

Restarted apache:

sudo service httpd restart
Stopping httpd: [ FAILED ]
Starting httpd: [ OK ]

Status check:

service httpd status
httpd (pid 6009) is running...

Finally confirmed that it’s working!

Oh and I will publish the improved LAMP puppet module as soon as I have time to test it.

~没有更多了~
我们使用 Cookies 和其他技术来定制您的体验包括您的登录状态等。通过阅读我们的 隐私政策 了解更多相关信息。 单击 接受 或继续使用网站,即表示您同意使用 Cookies 和您的相关数据。
原文