Bug 1212224 - SIGWINCH kills httpd
Summary: SIGWINCH kills httpd
Keywords:
Status: CLOSED NOTABUG
Alias: None
Product: Fedora
Classification: Fedora
Component: httpd
Version: rawhide
Hardware: Unspecified
OS: Unspecified
unspecified
unspecified
Target Milestone: ---
Assignee: Jan Kaluža
QA Contact: Fedora Extras Quality Assurance
URL:
Whiteboard:
Depends On:
Blocks:
TreeView+ depends on / blocked
 
Reported: 2015-04-15 22:04 UTC by Bruno Wolff III
Modified: 2015-06-29 19:11 UTC (History)
7 users (show)

Fixed In Version:
Doc Type: Bug Fix
Doc Text:
Clone Of:
Environment:
Last Closed: 2015-06-29 19:11:54 UTC
Type: Bug


Attachments (Terms of Use)
Out from a restart attempt (3.41 KB, text/plain)
2015-06-29 15:39 UTC, Bruno Wolff III
no flags Details
Sample working start up from f22, but config is different (2.17 KB, text/plain)
2015-06-29 16:04 UTC, Bruno Wolff III
no flags Details

Description Bruno Wolff III 2015-04-15 22:04:58 UTC
Description of problem:
When hhtpd is started via systemd it dies with the following showing up in the error_log:
[Wed Apr 15 16:48:58.903019 2015] [mpm_prefork:notice] [pid 5357] AH00170: caught SIGWINCH, shutting down gracefully

I don't see why a window size change shuold trigger a shutdown.

This doesn't happen when I run httpd directly as root in a terminal window.

Version-Release number of selected component (if applicable):
httpd-2.4.12-1.fc23.i686

Comment 1 Bruno Wolff III 2015-04-15 22:59:47 UTC
I need to clarify my last comment. When I just run httpd from the command line and let it detach from the terminal, it runs normally.

When I run httpd -DFOREGROUND, then it will stop after I change the terminal window size.

Comment 2 Jan Kaluža 2015-04-24 08:21:56 UTC
By starting httpd via systemd, you mean "systemctl start httpd"?

Comment 3 Bruno Wolff III 2015-04-24 20:22:16 UTC
http is failing to start both at initial boot and when I manually to to start it using "systemctl restart httpd".

Comment 4 Adam Williamson 2015-06-29 15:29:30 UTC
per https://bz.apache.org/bugzilla/show_bug.cgi?id=50669 , Apache uses the SIGWINCH kill signal as a 'graceful shutdown' trigger. Note that Apache's systemd service actually *uses* this - see from httpd.service:

# Send SIGWINCH for graceful stop
KillSignal=SIGWINCH
KillMode=mixed

so I suspect what's happening here is not that the SIGWINCH signal is some sort of stray or mistake, but that what you're seeing is systemd doing an orderly, intentional stopping of the service. In other words, the question isn't 'why does httpd shut down on a SIGWINCH?' or 'why does systemd send httpd a SIGWINCH?' but 'why does systemd want to stop the service right after it's started?'

A full log would help us tell for sure.

Comment 5 Bruno Wolff III 2015-06-29 15:30:20 UTC
In https://bz.apache.org/bugzilla/show_bug.cgi?id=50669 a change request to ignore SIGWINCH is closed won't fix. SIGWINCH might be used for doing clean shutdowns of httpd. So there might be a systemd bug or maybe some unexpected configuration is triggering systemd to do a shutdown right away.

Comment 6 Bruno Wolff III 2015-06-29 15:39:01 UTC
Created attachment 1044408 [details]
Out from a restart attempt

Comment 7 Adam Williamson 2015-06-29 15:45:44 UTC
Well, this looks like the problem to me:

Jun 29 10:36:39 bruno.wolff.to systemd[1]: httpd.service: Start operation timed out. Terminating.

basically, systemd doesn't believe httpd has fully started up; it waits a minute and half for the start operation to complete, then times out. When it hits the time out it stops the unit - that's where the SIGWINCH comes from, it is (as I suspected) systemd shutting down the unit on purpose.

So what we need to figure out is why systemd decides httpd hasn't fully started. Do you have any server certificates which require password entry?

Comment 8 Bruno Wolff III 2015-06-29 15:47:27 UTC
/lib/systemd/system/httpd.service hasn't changed between f22 and f23. And things work on f22.

Comment 9 Adam Williamson 2015-06-29 15:49:14 UTC
Sure, but clearly something different is happening in terms of Apache itself. there may be some clues in the Apache logs (/var/log/httpd ).

Comment 10 Bruno Wolff III 2015-06-29 15:50:43 UTC
No, no certs requiring a pass phrase. It doesn't take a minute and a half to background when I run it from the terminal. Perhaps I should see if selinux is blocking something? Also there may be other log info that I can find.

Comment 11 Bruno Wolff III 2015-06-29 15:57:44 UTC
Nothing obvious in the error_log, but it does have a 1.5 minute gap from when it starts to when the timeout is enforced.
[Mon Jun 29 10:51:27.485386 2015] [core:notice] [pid 26051] SELinux policy enabled; httpd running as context system_u:system_r:httpd_t:s0
[Mon Jun 29 10:51:27.488054 2015] [suexec:notice] [pid 26051] AH01232: suEXEC mechanism enabled (wrapper: /usr/sbin/suexec)
[Mon Jun 29 10:51:27.511507 2015] [auth_digest:notice] [pid 26051] AH01757: generating secret for digest authentication ...
[Mon Jun 29 10:51:27.523004 2015] [mpm_prefork:notice] [pid 26051] AH00163: Apache/2.4.12 (Fedora) configured -- resuming normal operations
[Mon Jun 29 10:51:27.523196 2015] [core:notice] [pid 26051] AH00094: Command line: '/usr/sbin/httpd -D FOREGROUND'
[Mon Jun 29 10:52:57.416631 2015] [mpm_prefork:notice] [pid 26051] AH00170: caught SIGWINCH, shutting down gracefully

Comment 12 Bruno Wolff III 2015-06-29 16:04:00 UTC
Created attachment 1044409 [details]
Sample working start up from f22, but config is different

The config is different. So they may not be directly comparable.

Comment 13 Bruno Wolff III 2015-06-29 16:05:20 UTC
This is what I get when I just start it from the command line:
[Mon Jun 29 11:04:16.827213 2015] [core:notice] [pid 29933] SELinux policy enabled; httpd running as context unconfined_u:unconfined_r:unconfined_t:s0-s0:c0.c1023
[Mon Jun 29 11:04:16.831342 2015] [suexec:notice] [pid 29933] AH01232: suEXEC mechanism enabled (wrapper: /usr/sbin/suexec)
[Mon Jun 29 11:04:16.859943 2015] [auth_digest:notice] [pid 29934] AH01757: generating secret for digest authentication ...
[Mon Jun 29 11:04:16.873835 2015] [mpm_prefork:notice] [pid 29934] AH00163: Apache/2.4.12 (Fedora) configured -- resuming normal operations
[Mon Jun 29 11:04:16.874094 2015] [core:notice] [pid 29934] AH00094: Command line: 'httpd'

Comment 14 Bruno Wolff III 2015-06-29 18:05:37 UTC
-DFOREGROUND doesn't seem to cause a problem with startup when running from a terminal.

Comment 15 Bruno Wolff III 2015-06-29 19:07:35 UTC
I have found this is configuration dependent. I'll report back the specifics when I narrow this down and will probably close it at that time.

Comment 16 Bruno Wolff III 2015-06-29 19:11:54 UTC
It looks like you need to run 00-systemd.conf if you want systemd to recognize that httpd has started successfully.


Note You need to log in before you can comment on or make changes to this bug.