Gentoo Websites Logo
Go to: Gentoo Home Documentation Forums Lists Bugs Planet Store Wiki Get Gentoo!

Bug 383093

Summary: www-servers/apache: refuses to stop with many active connections
Product: Gentoo Linux Reporter: Christian Ruppert (idl0r) <idl0r>
Component: [OLD] ServerAssignee: Peter Volkov (RETIRED) <pva>
Status: RESOLVED FIXED    
Severity: normal CC: apache-bugs, infra-bugs, mirage
Priority: Normal    
Version: unspecified   
Hardware: All   
OS: Linux   
Whiteboard:
Package list:
Runtime testing required: ---

Description Christian Ruppert (idl0r) gentoo-dev 2011-09-15 13:44:08 UTC
See $Summary, I don't have a log snipped handy right now but:
@pva_theor | idl0r: please open bug for this. I remeber I saw this problem but I'll need to investigate this more.

Adding -R/--retry (start-stop-daemon) should help.
Currently it stops Apache but it takes some time till all childs/connections have been closed properly so start-stop-daemon times out. A few seconds later are all childs/connections closed and Apache did not restart because of the timeout.

All versions of Apache / the init script are affected.
Comment 1 Peter Volkov (RETIRED) gentoo-dev 2011-10-18 06:43:30 UTC
Thank you for report. Actually after investigation I've decided to remove s-s-d from stop(). Idea is that I'd like our init script be a bit more fool proof and thus I've added logic to check that parent exited `! test -f "${PIDFILE}"` and childs exited too `pgrep -P ${PID} apache2`. That said I've increased timeout to 15.
Comment 2 Oleg Muraviov 2012-02-07 12:44:24 UTC
I think it's incorrect test:
/etc/init.d/apache2:105
while ( ! test -f "${PIDFILE}" && pgrep -P ${PID} apache2 >/dev/null ) 

Probably it should be:
 while ( test -f "${PIDFILE}" && pgrep -P ${PID} apache2 >/dev/null )

Because pgrep will always false if there is no ${PIDFILE}.
So this while loop never happens in original script.

Am I right?