10

When running service apache start I see in the log file this entry:

[mpm_event:notice] [pid 1906:tid XXX] AH00489: Apache/2.4.23 (Unix)
                         OpenSSL/1.0.2g PHP/7.0.9 configured -- resuming normal operations
[core:notice] [pid 1906:tid XXX] AH00094: Command line: '/usr/sbin/httpd'
[mpm_event:notice] [pid 1906:tid XXX] AH00492: caught SIGWINCH, shutting down gracefully

and the service apache does not start? I can find in internet what SIGWINCH means [Window size change] but it does not really help me in this case.

The file /etc/systemd/system/apache.service:

[Unit]
Description=The Apache Webserver [FaF Compiled]
After=network.target nss-lookup.target time-sync.target
Before=getty@tty1.service plymouth-quit.service xdm.service

[Service]
Type=notify
PrivateTmp=true
ExecStart=/usr/sbin/httpd -k start
ExecReload=/usr/sbin/httpd -k graceful
ExecStop=/usr/sbin/httpd -k graceful-stop
KillMode=mixed

[Install]
WantedBy=multi-user.target
Alias=httpd.service apache.service

Running on SLES 12 SP1. I have compiled Apache on my own. Starting it with apachectl -k start works perfectly and I can access and run the PHP code.

My question: What am I doing wrong that the apache service does not start. I have enabled it with systemctl enable apache. This was the output:

ln -s '/usr/lib/systemd/system/apache2.service' '/etc/systemd/system/httpd.service'
ln -s '/usr/lib/systemd/system/apache2.service' '/etc/systemd/system/apache.service'
ln -s '/usr/lib/systemd/system/apache2.service' '/etc/systemd/system/multi-user.target.wants/apache2.service'
  • How were SIGWINCH made fatal? The default action is to discard the signal. – thrig Aug 8 '16 at 17:01
3

systemd is instructing Apache to stop with graceful-stop, which generates a SIGWINCH signal, and hence the log caught SIGWINCH, shutting down gracefully. (the SIGWINCH signal is (ab)used by Apache)

IMO, there is a possibility of another error, including configuration errors, making it stop, and you are looking at related symptoms which are normal behaviour.

I would recommend perusing your Apache error logs, usually by default in SLES under the directory /var/log/apache2.

1

I found a similar problem reported on RedHat. Closed with a status "NOTABUG". Eventually recognised as wrong config.

img #1 1


img #2 2


img #3 3


UPDATE

I found one more similar problem reported on serverfault. And one more in the answer to it, in the image below.

img 1/1enter image description here

  • -DFOREGROUND does not help in my case. Apache does start but it does not return back to service and therefore service complains with apache2.service start operation timed out. Terminating. – Al Bundy Aug 8 '16 at 20:18
  • Did you read the thread in the link? – Tomasz Aug 8 '16 at 20:19
  • 1
    I gave up. I understand the situation but I don't have a clue how to fix it. I found out when I remove ExecReload= from /usr/lib/systemd/system/apache2.service then SIGWINCH is not sent but then Apache does not start - no error message in log, nothing. It just immediately quits when it has been started. I implemented now the hack that I run apachectl -k start as a cron job when the system starts. I can restart Apache with apachectl -k restart. I will try it later; may be I get some new ideas. – Al Bundy Aug 8 '16 at 22:16
  • I found one more, different. See update. – Tomasz Aug 8 '16 at 22:37
0

From a comment on the Red Hat bug report linked from Tomasz's answer:

It looks like you need to run 00-systemd.conf if you want systemd to recognize that httpd has started successfully.

I ran this and it worked:

ln -sr /etc/httpd/conf.modules.d/00-systemd.conf /etc/httpd/conf.d/00-systemd.conf
systemctl restart httpd

I'm on Amazon Linux 2 (will probably also work on RHEL/Centos 7).

  • Thanks for giving credit, but, … where did you get this? – G-Man Nov 14 '18 at 20:43
  • @G-Man I've edited this answer to correctly attribute that quote. – Anthony Geoghegan Mar 5 at 14:55

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.