Redhat – still “httpd dead but subsys locked” even following the fix of some source

httpdredhat

Here is what I have tried so far:

edit: /etc/sysconfig/httpd

PIDFILE=/var/run/httpd.pid

edit: /etc/httpd/conf/httpd.conf

PidFile /var/run/httpd.pid

then

killall -9 httpd

result:

httpd: no process killed

then:

sudo rm -f /var/lock/subsys/httpd
sudo service httpd restart

result:

Stopping httpd:                                            [FAILED]
Starting httpd:                                            [  OK  ]

then:

sudo service httpd status

result:

httpd dead but subsys locked

Still no LUCK, did I miss a fix on this issue? please help

NOTE: its not generating a httpd.pid on /var/run when I start the httpd

Apache Error Log

[Tue Dec 10 06:27:42 2013] [notice] Digest: generating secret for digest authentication ...
[Tue Dec 10 06:27:42 2013] [notice] Digest: done
[Tue Dec 10 06:31:27 2013] [notice] Digest: generating secret for digest authentication ...
[Tue Dec 10 06:31:27 2013] [notice] Digest: done
[Tue Dec 10 06:45:21 2013] [notice] Digest: generating secret for digest authentication ...
[Tue Dec 10 06:45:21 2013] [notice] Digest: done
[Tue Dec 10 06:52:47 2013] [notice] Digest: generating secret for digest authentication ...
[Tue Dec 10 06:52:47 2013] [notice] Digest: done
[Tue Dec 10 06:55:46 2013] [notice] Digest: generating secret for digest authentication ...
[Tue Dec 10 06:55:46 2013] [notice] Digest: done
[Tue Dec 10 07:06:21 2013] [notice] Digest: generating secret for digest authentication ...
[Tue Dec 10 07:06:21 2013] [notice] Digest: done
[Tue Dec 10 07:13:35 2013] [notice] Digest: generating secret for digest authentication ...
[Tue Dec 10 07:13:35 2013] [notice] Digest: done
[Tue Dec 10 07:20:44 2013] [notice] Digest: generating secret for digest authentication ...
[Tue Dec 10 07:20:44 2013] [notice] Digest: done

ADDITIONAL INFO

ps auxwww

USER       PID %CPU %MEM    VSZ   RSS TTY      STAT START   TIME COMMAND
root         1  0.0  0.2  19316  1512 ?        Ss   06:44   0:00 /sbin/init
root         2  0.0  0.0      0     0 ?        S    06:44   0:00 [kthreadd]
root         3  0.0  0.0      0     0 ?        S    06:44   0:00 [ksoftirqd/0]
root         4  0.0  0.0      0     0 ?        S    06:44   0:00 [migration/0]
root         5  0.0  0.0      0     0 ?        S    06:44   0:00 [watchdog/0]
root         6  0.0  0.0      0     0 ?        S    06:44   0:00 [events/0]
root         7  0.0  0.0      0     0 ?        S    06:44   0:00 [cpuset]
root         8  0.0  0.0      0     0 ?        S    06:44   0:00 [khelper]
root        17  0.0  0.0      0     0 ?        S    06:44   0:00 [netns]
root        18  0.0  0.0      0     0 ?        S    06:44   0:00 [async/mgr]
root        23  0.0  0.0      0     0 ?        S    06:44   0:00 [xenwatch]
root        24  0.0  0.0      0     0 ?        S    06:44   0:00 [xenbus]
root        72  0.0  0.0      0     0 ?        S    06:44   0:00 [sync_supers]
root        74  0.0  0.0      0     0 ?        S    06:44   0:00 [bdi-default]
root        75  0.0  0.0      0     0 ?        S    06:44   0:00 [kintegrityd/0]
root        77  0.0  0.0      0     0 ?        S    06:44   0:00 [kblockd/0]
root        84  0.0  0.0      0     0 ?        S    06:44   0:00 [kseriod]
root       193  0.0  0.0      0     0 ?        S    06:44   0:00 [khungtaskd]
root       194  0.0  0.0      0     0 ?        S    06:44   0:00 [kswapd0]
root       195  0.0  0.0      0     0 ?        SN   06:44   0:00 [ksmd]
root       248  0.0  0.0      0     0 ?        S    06:44   0:00 [aio/0]
root       251  0.0  0.0      0     0 ?        S    06:44   0:00 [crypto/0]
root       263  0.0  0.0      0     0 ?        S    06:44   0:00 [khvcd]
root       343  0.0  0.0      0     0 ?        S    06:44   0:00 [kstriped]
root       533  0.0  0.0      0     0 ?        S    06:44   0:00 [jbd2/xvda1-8]
root       534  0.0  0.0      0     0 ?        S    06:44   0:00 [ext4-dio-unwrit]
root       557  0.0  0.0      0     0 ?        S    06:44   0:00 [flush-202:1]
root       564  0.0  0.0      0     0 ?        S    06:44   0:00 [khubd]
root       614  0.0  0.1  10772   716 ?        S<s  06:44   0:00 /sbin/udevd -d
root       834  0.0  0.0      0     0 ?        S    06:45   0:00 [kauditd]
root       985  0.0  0.0   9220   588 ?        Ss   06:45   0:00 /sbin/dhclient -1 -q -lf /var/lib/dhclient/dhclient-eth0.leases -pf /var/run/dhclient-eth0.pid eth0
root      1022  0.0  0.2 248984  1272 ?        Sl   06:45   0:00 /sbin/rsyslogd -c 4
root      1072  0.0  0.1  64396  1096 ?        Ss   06:45   0:00 /usr/sbin/sshd
ntp       1079  0.0  0.2  30424  1656 ?        Ss   06:45   0:00 ntpd -u ntp:ntp -p /var/run/ntpd.pid -g
root      1094  0.0  0.3  86952  2356 ?        Ss   06:45   0:00 sendmail: accepting connections
smmsp     1102  0.0  0.3  78428  2068 ?        Ss   06:45   0:00 sendmail: Queue runner@01:00:00 for /var/spool/clientmqueue
mongod    1115  0.4  2.2 627080 13872 ?        Sl   06:45   0:35 /usr/bin/mongod -f /etc/mongod.conf
root      1123  0.0  0.2 117288  1228 ?        Ss   06:45   0:00 crond
root      1134  0.0  0.0  23724   396 ?        Ss   06:45   0:00 /usr/sbin/atd
zend      1191  0.0  0.1  23956  1084 ?        Ss   06:45   0:00 /usr/local/zend/bin/watchdog -c /usr/local/zend/etc/watchdog-monitor.ini -u 221 -g 498 -s monitor
zend      1193  0.0  0.5 350012  3616 ?        Ssl  06:45   0:00 /usr/local/zend/bin/MonitorNode /usr/local/zend/etc/monitor_node.ini /usr/local/zend/etc/conf.d -e
zend      1266  0.0  0.1  23956  1092 ?        Ss   06:45   0:00 /usr/local/zend/bin/watchdog -c /usr/local/zend/etc/watchdog-sc.ini -u 221 -g 498 -s scd
zend      1268  0.0  0.5 656968  3316 ?        Ssl  06:45   0:00 /usr/local/zend/bin/scd -p /usr/local/zend/etc/scd.ini -e
zend      1325  0.0  0.1  23956  1088 ?        Ss   06:45   0:00 /usr/local/zend/bin/watchdog -c /usr/local/zend/etc/watchdog-deployment.ini -u 221 -g 498 -s zdd
zend      1327  0.1  0.6 203324  3748 ?        Ssl  06:45   0:09 /usr/local/zend/bin/zdd /usr/local/zend/etc/zdd.ini -e
zend      1374  0.0  0.1  23956  1088 ?        Ss   06:45   0:00 /usr/local/zend/bin/watchdog -c /usr/local/zend/etc/watchdog-jq.ini -u 221 -g 498 -s jqd
zend      1376  0.0  0.6 137456  4140 ?        Ss   06:45   0:01 /usr/local/zend/bin/jqd -f /usr/local/zend/etc/jqd.ini -e
root      1420  0.0  0.1  23956  1088 ?        Ss   06:45   0:00 /usr/local/zend/bin/watchdog -c /usr/local/zend/etc/watchdog-lighttpd.ini -u zend -g zend -s lighttpd
zend      1422  0.0  0.3  26840  1880 ?        Ss   06:45   0:00 /usr/local/zend/gui/lighttpd/sbin/lighttpd -m /usr/local/zend/gui/lighttpd/lib -f /usr/local/zend/gui/lighttpd/etc/lighttpd.conf -D
root      1446  0.0  0.0   4164   576 tty1     Ss+  06:45   0:00 /sbin/mingetty /dev/tty1
root      1448  0.0  0.0   4164   576 tty2     Ss+  06:45   0:00 /sbin/mingetty /dev/tty2
root      1450  0.0  0.0   4164   576 tty3     Ss+  06:45   0:00 /sbin/mingetty /dev/tty3
root      1452  0.0  0.0   4164   576 tty4     Ss+  06:45   0:00 /sbin/mingetty /dev/tty4
root      1455  0.0  0.0   4164   572 tty5     Ss+  06:45   0:00 /sbin/mingetty /dev/tty5
root      1459  0.0  0.1  10768   688 ?        S<   06:45   0:00 /sbin/udevd -d
root      1460  0.0  0.1  10768   688 ?        S<   06:45   0:00 /sbin/udevd -d
root      1461  0.0  0.1   4176   624 hvc0     Ss+  06:45   0:00 /sbin/agetty /dev/hvc0 38400 vt100-nav
root      1462  0.0  0.0   4164   572 tty6     Ss+  06:45   0:00 /sbin/mingetty /dev/tty6
root      1472  0.0  2.2 337484 13888 ?        SN   06:45   0:00 /usr/bin/python -tt /usr/sbin/yum-updatesd
root      1474  0.0  0.1   9336  1204 ?        SN   06:45   0:00 /usr/libexec/gam_server
root      1483  0.0  0.6 100236  3908 ?        Ss   06:47   0:00 sshd: ec2-user [priv]
ec2-user  1486  0.0  0.2 100236  1744 ?        S    06:47   0:00 sshd: ec2-user@pts/0
ec2-user  1487  0.0  0.4 109456  3012 pts/0    Ss   06:47   0:00 -bash
ec2-user  1963  0.0  0.1 108112  1132 pts/0    R+   08:58   0:00 ps auxwww

sudo find /etc/httpd /etc/zce.rc -type f -exec grep -i errorlog {} /dev/null \;

/etc/httpd/conf/httpd.conf:# ErrorLog: The location of the error log file.
/etc/httpd/conf/httpd.conf:# If you do not specify an ErrorLog directive within a <VirtualHost>
/etc/httpd/conf/httpd.conf:ErrorLog logs/error_log
/etc/httpd/conf/httpd.conf:#    ErrorLog logs/dummy-host.example.com-error_log
/etc/httpd/conf/httpd.conf.rpmnew:# ErrorLog: The location of the error log file.
/etc/httpd/conf/httpd.conf.rpmnew:# If you do not specify an ErrorLog directive within a <VirtualHost>
/etc/httpd/conf/httpd.conf.rpmnew:ErrorLog logs/error_log
/etc/httpd/conf/httpd.conf.rpmnew:#    ErrorLog logs/dummy-host.example.com-error_log
/etc/httpd/conf.d/zendserver_gui.conf:        ErrorLog /usr/local/zend/var/log/gui_vhost_error.log
/etc/httpd/conf.d/ssl.conf:ErrorLog logs/ssl_error_log

Best Answer

Had the same error on my server:

> service httpd status
httpd dead but subsys locked

Found, that the directory /var/run/httpd was NOT readable/executable by world:

drwx------   2 root      apache    4096 Apr 23 14:15 /var/run/httpd

Therefore any user (beside root) could not examine the pidfile (which did exist)! The httpd-Process was already running fine, but the service command could not read the pidfile ...

# chmod a+rx /var/run/httpd

did fix the issue:

> service httpd status
httpd (pid  2848) is running...
Related Topic