httpd dead but subsys locked

[simterm]$httpd dead but subsys locked[/simterm]

If there is no httpd processes and already tried to restart the services, somehow above output is given for httpd status.

WTF happen? One of solution is as below :

  • Check running processes

 ipcs -s | grep apache

  • Stop the freaking processes

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

  • Remove httpd lock files

cd /var/lock/subsys
rm httpd

  • Restart httpd. Everything should be okay :)