Why is Apache trying to kill a process on startup and why would that cause a failure for Apache to start?

I was installing a new cert like I've done dozens of times before. I copied the names crt, key, bundle files as backup and gave the new files the names of the old files. Then I restarted apache. It failed. It gave an error like what's below.

I tried rebooting the server. Checking again, no difference. I removed the newly uploaded files and replaced with the backup copies and tried restarting again. It still gives the same message. I've never seen this error before. There have not been any changes to the config files.

1) Someone who understands the inner workings of Apache, why would it try to kill a process that doesn't exist and that it can't find?

2) Being that it's not there, why would that prevent Apache from starting?

sudo systemctl status httpd:

● httpd.service - The Apache HTTP Server
   Loaded: loaded (/usr/lib/systemd/system/httpd.service; enabled; vendor preset: disabled)
   Active: failed (Result: exit-code) since Thu 2018-12-06 23:12:20 EST; 9s ago
     Docs: man:httpd(8)
           man:apachectl(8)
  Process: 3615 ExecStop=/bin/kill -WINCH ${MAINPID} (code=exited, status=1/FAILURE)
  Process: 3613 ExecStart=/usr/sbin/httpd $OPTIONS -DFOREGROUND (code=exited, status=1/FAILURE)
 Main PID: 3613 (code=exited, status=1/FAILURE)

Dec 06 23:12:20 myHostsystemd[1]: Starting The Apache HTTP Server...
Dec 06 23:12:20 myHostsystemd[1]: httpd.service: main process exited, code=exited, status=1/FAILURE
Dec 06 23:12:20 myHostkill[3615]: kill: cannot find process ""
Dec 06 23:12:20 myHostsystemd[1]: httpd.service: control process exited, code=exited status=1
Dec 06 23:12:20 myHostsystemd[1]: Failed to start The Apache HTTP Server.
Dec 06 23:12:20 myHostsystemd[1]: Unit httpd.service entered failed state.
Dec 06 23:12:20 myHostsystemd[1]: httpd.service failed.

sudo journalctl -xe just says the same thing.

The server is running centOS 7. Apache version is 2.4.6.


Solution 1:

Your service unit has kill call on the ExecStop action, so this isn't apache who's trying to kill his child, it's systemd trying to kill the process that has alredy ceased to be.

And the main reason why apache cannot start is this process exit. I bet the reason is stated in apache's main error_log.

  • RHEL / Red Hat / CentOS / Fedora Linux Apache error file location: /var/log/httpd/error_log
  • Debian / Ubuntu Linux Apache error log file location: /var/log/apache2/error.log
  • FreeBSD Apache error log file location: /var/log/httpd-error.log