httpd service failed, but httpd procsses running

General support questions
Post Reply
czg
Posts: 12
Joined: 2017/01/25 15:04:15

httpd service failed, but httpd procsses running

Post by czg » 2017/10/16 14:14:43

Following a large "yum update all" my httpd service seems to have got confused about its status:

Code: Select all

[root@server ~]# service httpd status
Redirecting to /bin/systemctl status httpd.service
? httpd.service - The Apache HTTP Server
   Loaded: loaded (/usr/lib/systemd/system/httpd.service; enabled; vendor preset: disabled)
   Active: failed (Result: exit-code) since Mon 2017-10-16 14:18:25 BST; 30min ago
     Docs: man:httpd(8)
           man:apachectl(8)
  Process: 15032 ExecStop=/bin/kill -WINCH ${MAINPID} (code=exited, status=1/FAILURE)
  Process: 14913 ExecStart=/usr/sbin/httpd $OPTIONS -DFOREGROUND (code=exited, status=1/FAILURE)
 Main PID: 14913 (code=exited, status=1/FAILURE)

Oct 16 14:18:25 server httpd[14913]: (98)Address already in use: AH00072: make_sock: could not bind to address [::]:80
Oct 16 14:18:25 server httpd[14913]: (98)Address already in use: AH00072: make_sock: could not bind to address 0.0.0.0:80
Oct 16 14:18:25 server httpd[14913]: no listening sockets available, shutting down
Oct 16 14:18:25 server httpd[14913]: AH00015: Unable to open logs
Oct 16 14:18:25 server systemd[1]: httpd.service: main process exited, code=exited, status=1/FAILURE
Oct 16 14:18:25 server kill[15032]: kill: cannot find process ""
Oct 16 14:18:25 server systemd[1]: httpd.service: control process exited, code=exited status=1
Oct 16 14:18:25 server systemd[1]: Failed to start The Apache HTTP Server.
Oct 16 14:18:25 server systemd[1]: Unit httpd.service entered failed state.
Oct 16 14:18:25 server systemd[1]: httpd.service failed.
[root@server ~]# ps -ef | grep httpd
root     11843     1  0 13:32 ?        00:00:00 /usr/sbin/httpd
apache   11936 11843  0 13:33 ?        00:00:00 /usr/sbin/httpd
apache   11937 11843  0 13:33 ?        00:00:00 /usr/sbin/httpd
apache   11938 11843  0 13:33 ?        00:00:00 /usr/sbin/httpd
apache   11939 11843  0 13:33 ?        00:00:00 /usr/sbin/httpd
apache   11940 11843  0 13:33 ?        00:00:00 /usr/sbin/httpd
apache   15950 11843  0 14:32 ?        00:00:00 /usr/sbin/httpd
root     17057 16962  0 14:48 pts/0    00:00:00 grep --color=auto httpd
[root@server ~]# uptime
 14:49:33 up  1:38,  1 user,  load average: 0.00, 0.02, 0.05
I think the httpd processes were started by me running /usr/sbin/httpd shortly after a reboot and so far as I can see the web page is operating normally.

How can I get them back in sync?

The only recent changes were:

Code: Select all

  423  yum update -y
  424  yum install net-snmp net-snmp-utils
  425  vi /etc/yum.conf
  426  snmpwalk <parms>
  427  firewall-cmd --permanent --add-port=162/udp
  428  firewall-cmd --permanent --add-port=161/udp
  429  snmpwalk <parms>
  430  systemctl restart firewalld

User avatar
TrevorH
Site Admin
Posts: 33216
Joined: 2009/09/24 10:40:56
Location: Brighton, UK

Re: httpd service failed, but httpd procsses running

Post by TrevorH » 2017/10/16 15:15:15

Look in /run/httpd/httpd.pid and see if the pid there corresponds with one of the httpd processes that are running - most likely 11843. If so then it just means someone did a systemctl start httpd when it was already running. If no then pick a convenient time and kill all the running ones and then start it up properly.
The future appears to be RHEL or Debian. I think I'm going Debian.
Info for USB installs on http://wiki.centos.org/HowTos/InstallFromUSBkey
CentOS 5 and 6 are deadest, do not use them.
Use the FAQ Luke

Post Reply