"service stop; service start" fails with wsgi.py from freeipa-server
Affects | Status | Importance | Assigned to | Milestone | |
---|---|---|---|---|---|
| apache2 (Ubuntu) |
Undecided
|
Unassigned |
Bug Description
If apache is running, doing 'systemctl stop apache2.service; systemctl start apache2.service' fails with:
● apache2.service - LSB: Apache2 web server
Loaded: loaded (/etc/init.
Active: failed (Result: exit-code) since to 2015-03-05 20:33:16 EET; 6s ago
Docs: man:systemd-
Process: 27891 ExecStop=
Process: 27943 ExecStart=
maalis 05 20:32:56 ipa02.tyrell apache2[27943]: no listening sockets available, shutting down
maalis 05 20:32:56 ipa02.tyrell apache2[27943]: AH00015: Unable to open logs
maalis 05 20:32:56 ipa02.tyrell apache2[27943]: Action 'start' failed.
maalis 05 20:32:56 ipa02.tyrell apache2[27943]: The Apache error log may have more information.
maalis 05 20:33:16 ipa02.tyrell systemd[1]: apache2.service: control process exited, code=exited status=1
maalis 05 20:33:16 ipa02.tyrell systemd[1]: Failed to start LSB: Apache2 web server.
maalis 05 20:33:16 ipa02.tyrell systemd[1]: Unit apache2.service entered failed state.
maalis 05 20:33:16 ipa02.tyrell systemd[1]: apache2.service failed.
maalis 05 20:33:16 ipa02.tyrell apache2[27943]: *
maalis 05 20:33:16 ipa02.tyrell apache2[27943]: * The apache2 instance did not start within 20 seconds. Please read the log files to discover problems
error.log doesn't have more than this:
[Thu Mar 05 20:32:56.258403 2015] [mpm_event:notice] [pid 27786:tid 139760377153408] AH00491: caught SIGTERM, shutting down
so stopping the service returns too quickly and start gets run too early?
Timo Aaltonen (tjaalton) wrote : | #1 |
Steve Langasek (vorlon) wrote : | #2 |
Your output shows that systemd is invoking the init script for apache2, because there is no native systemd unit in the package. So this is not a problem specific to systemd, the init script must be racy when running under sysvinit as well. (And even under upstart, since apache2 has no upstart job.)
Timo Aaltonen (tjaalton) wrote : | #3 |
That might be, but the repro rate on systemd is 100%, while I haven't been able to reproduce it with upstart.
tags: | added: systemd-boot |
Timo Aaltonen (tjaalton) wrote : | #4 |
Hm, this seems to be related to mod_nss being enabled with Freeipa. Disabling it fixes apache2 restart, though installing & enabling it doesn't fail restart with upstart..
Martin Pitt (pitti) wrote : | #5 |
> maalis 05 20:32:56 ipa02.tyrell apache2[27943]: no listening sockets available, shutting down
> maalis 05 20:32:56 ipa02.tyrell apache2[27943]: AH00015: Unable to open logs
That's certainly a good hint where to start. What socket/log dir is apache trying to create?
Timo Aaltonen (tjaalton) wrote : | #6 |
I'm getting a better error on Debian
maalis 06 09:43:20 ipa01 apache2[2223]: Starting web server: apache2(98)Address already in use: AH00072: make_sock: could not bind to address [::]:443
maalis 06 09:43:20 ipa01 apache2[2223]: (98)Address already in use: AH00072: make_sock: could not bind to address 0.0.0.0:443
maalis 06 09:43:20 ipa01 apache2[2223]: no listening sockets available, shutting down
maalis 06 09:43:20 ipa01 apache2[2223]: AH00015: Unable to open logs
not sure if the logs part is significant here, maybe just fallout from failing to bind
Timo Aaltonen (tjaalton) wrote : | #7 |
So it's freeipa-server apache config that causes it, not mod_nss. Turns out it's mod_wsgi, this is enough to reproduce the failure:
WSGISocketPrefix /run/apache2/wsgi
WSGIDaemonProcess ipa processes=6 threads=1 maximum-
WSGIProcessGroup ipa
WSGIApplication
WSGIImportScript /usr/share/
put it in conf-enabled/
Timo Aaltonen (tjaalton) wrote : | #8 |
hrm, wsgi.py depends on python-freeipa, which itself has modules that import stuff from freeipa-server, so it's not that simple to reproduce
Timo Aaltonen (tjaalton) wrote : | #9 |
that said, it fails with upstart too
summary: |
- "service stop; service start" fails with systemd + "service stop; service start" fails with wsgi.py from freeipa-server |
tags: | removed: systemd-boot |
this works with upstart and IIRC sysv (debian)