apache2 fails to wait on stop/restart
Apache2 is failing to wait for all its threads to terminate when stopping. This leaves TCP ports still in use when apache2 tires to restart. This has been seen on Trusty and Xenial
This becomes a problems on restarts and stop/starts.
I have seen this running a simple loop with service apache2 restart. However this is inconsistent.
It happens more predictably when wsgi is involved even if stop and then start are used instead of restart:
* Stopping web server apache2
* Starting web server apache2
(98)Address already in use: AH00072: make_sock: could not bind to address [::]:80
(98)Address already in use: AH00072: make_sock: could not bind to address 0.0.0.0:80
no listening sockets available, shutting down
AH00015: Unable to open logs
Action 'start' failed.
The Apache error log may have more information.