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

Bug 152587

Summary: apache cannot be restarted by a demon
Product: Gentoo Linux Reporter: Zdenek Behan <rain>
Component: Current packagesAssignee: Apache Team - Bugzilla Reports <apache-bugs>
Status: RESOLVED UPSTREAM    
Severity: normal    
Priority: High    
Version: unspecified   
Hardware: All   
OS: Linux   
Whiteboard:
Package list:
Runtime testing required: ---

Description Zdenek Behan 2006-10-23 12:46:03 UTC
When using /etc/init.d/apache2 start|restart from within a terminalless daemon (cron, watchdog, ..), apache2 instead of starting generates quite a few of he following lines into its error_log:

[error] (88)Socket operation on non-socket: apr_accept: (client socket)

The reason for this is apache starting without stdin connected.
Same behaviour as that of daemons can be repeated by closing fd 0 when running the command from within bash:

/etc/init.d/apache2 restart 0>&-

This acts as if everything went fine, except apache does not really start and produces the described error messages.

Tested for current x86 stable version of apache, but it is an upstream unfixed bug, so i believe the same thing should apply for ALL other versions of apache in portage.

Fixes are:
1) run apache using "screen /etc/init.d/apache2 restart"
2) connect /dev/null to its stdin... "/etc/init.d/apache2 restart </dev/null"
3) probably the best solution: modify the apache2 init script to do something similar to 2)
Comment 1 Michael Stewart (vericgar) (RETIRED) gentoo-dev 2006-10-23 20:50:35 UTC
http://issues.apache.org/bugzilla/show_bug.cgi?id=15161
http://issues.apache.org/bugzilla/show_bug.cgi?id=33994

This is a problem with the software calling apache, not with apache. The software calling apache has closed stderr and/or stdout. It could also be caused by extreme ulimits.

If this is different from the above bugs, please file a new bug upstream.