Please read this before reporting a bug:
https://wiki.archlinux.org/title/Bug_reporting_guidelines
Do NOT report bugs when a package is just outdated, or it is in the AUR. Use the 'flag out of date' link on the package page, or the Mailing List.
REPEAT: Do NOT report bugs for outdated packages!
https://wiki.archlinux.org/title/Bug_reporting_guidelines
Do NOT report bugs when a package is just outdated, or it is in the AUR. Use the 'flag out of date' link on the package page, or the Mailing List.
REPEAT: Do NOT report bugs for outdated packages!
FS#43486 - [apache] 'systemctl stop' and shutdown hangs +- 60s
Attached to Project:
Arch Linux
Opened by Vincent Van Houtte (zenlord) - Saturday, 17 January 2015, 10:33 GMT
Last edited by Anatol Pomozov (anatolik) - Wednesday, 27 January 2016, 04:33 GMT
Opened by Vincent Van Houtte (zenlord) - Saturday, 17 January 2015, 10:33 GMT
Last edited by Anatol Pomozov (anatolik) - Wednesday, 27 January 2016, 04:33 GMT
|
DetailsDescription:
Whenever I stop apache using the 'systemctl stop' command, it takes a while to actually stop the service and return a new prompt. The behaviour is the same when shutting down the system while the apache daemon is running, causing long shutdown delays. Additional info: * package version(s) Archlinux 64, updated (but problem has existed a few months now on my laptop, which I seldom use) * config and/or log files etc. Same bug in Fedora bugtracker: https://bugzilla.redhat.com/show_bug.cgi?id=906321 Steps to reproduce: systemctl stop httpd or reboot / shutdown -h now Solution / workaround: Add 'KillMode=none' to httpd.service-file (I'm not sure how 'clean' this is as a solution/workaround, but it does work) |
This task depends upon
http://httpd.apache.org/docs/trunk/mod/mod_systemd.html
It doesn't occur all the time, but when it occurs systemd takes a very long time when he wants to stop httpd service,
I am wondering if the problem would be the /usr/lib/systemd/system/httpd.service file, a wrong parameter inside this file ?
Might looking at http://pkgs.fedoraproject.org/cgit/httpd.git/log/httpd.service?h=f23 be of use in any way?
systemd[1]: httpd.service: State 'stop-final-sigterm' timed out. Killing.
systemd[1]: httpd.service: Unit entered failed state.
systemd[1]: httpd.service: Failed with result 'timeout'.
$ systemctl status httpd
● httpd.service - Apache Web Server
Loaded: loaded (/usr/lib/systemd/system/httpd.service; disabled; vendor preset: disabled)
Active: failed (Result: timeout) since mar. 2015-10-27 20:04:15 CET; 1h 16min ago
Process: 2415 ExecStop=/usr/bin/apachectl graceful-stop (code=exited, status=0/SUCCESS)
Process: 2266 ExecStart=/usr/bin/apachectl start (code=exited, status=0/SUCCESS)
Main PID: 2269 (code=exited, status=0/SUCCESS)
KillSignal=SIGWINCH
KillMode=mixed
Could you please try it and see if any of these options fixes the problem for you?
I notice also this error message in journalctl :
httpd.service: PID file /run/httpd/httpd.pid not readable (yet?) after start: No such file or directory
the wiki gives this solution but it doesn't work :
https://wiki.archlinux.org/index.php/Apache_HTTP_Server#Error:_PID_file_.2Frun.2Fhttpd.2Fhttpd.pid_not_readable_.28yet.3F.29_after_start
BTW I just merged this change https://projects.archlinux.org/svntogit/packages.git/commit/trunk?h=packages/apache&id=7e862c952493c891ddc3497824138574438a4c76 Could you please try if it makes any difference for you?
systemd[1]: httpd.service: State 'stop-final-sigterm' timed out. Killing.
systemd[1]: httpd.service: Unit entered failed state.
systemd[1]: httpd.service: Failed with result 'timeout'.
but I think that adding these two lines ( from fedora ) can solve the problem :
KillSignal=SIGWINCH
KillMode=mixed
but I am not sure at 100% because it's a random bug ( it's difficult to reproduce it )
the complete new httpd systemd file :
[Unit]
Description=Apache Web Server
After=network.target remote-fs.target nss-lookup.target
[Service]
Type=forking
PIDFile=/run/httpd/httpd.pid
ExecStart=/usr/bin/apachectl start
ExecStop=/usr/bin/apachectl graceful-stop
ExecReload=/usr/bin/apachectl graceful
PrivateTmp=true
LimitNOFILE=infinity
KillSignal=SIGWINCH
KillMode=mixed
[Install]
WantedBy=multi-user.target
My submitted change is not for this bug but a simplification that removes need for a background process. I am not going to revert unless it introduces new problems.
KillSignal=SIGWINCH
or
KillMode=mixed
Or both required.
KillMode=mixed