Bug 46387 - initlog causes some daemons to die with SIGPIPE
initlog causes some daemons to die with SIGPIPE
Status: CLOSED WONTFIX
Product: Red Hat Linux
Classification: Retired
Component: initscripts (Show other bugs)
6.2
All Linux
medium Severity medium
: ---
: ---
Assigned To: Bill Nottingham
Brock Organ
:
Depends On:
Blocks:
  Show dependency treegraph
 
Reported: 2001-06-28 05:27 EDT by peter.benie
Modified: 2014-03-16 22:21 EDT (History)
1 user (show)

See Also:
Fixed In Version:
Doc Type: Bug Fix
Doc Text:
Story Points: ---
Clone Of:
Environment:
Last Closed: 2005-02-15 15:55:45 EST
Type: ---
Regression: ---
Mount Type: ---
Documentation: ---
CRM:
Verified Versions:
Category: ---
oVirt Team: ---
RHEL 7.3 requirements from Atomic Host:
Cloudforms Team: ---


Attachments (Terms of Use)

  None (edit)
Description peter.benie 2001-06-28 05:27:40 EDT
From Bugzilla Helper:
User-Agent: Mozilla/4.75 [en] (X11; U; Linux)

Description of problem:
initlog -c <cmd> (used by daemon() in init.d/functions) runs the specified
command as a child. initlog's event loop waits for the following
conditions:
 - data from the command's stdout
 - data from the command's stderr
 - SIGCHLD

initlog dies when it receives SIGCHLD.

If the command daemonizes (ie. it fork()s and the parent dies), and then
produces output on stdout or stderr, it gets an error back (either SIGPIPE
or EPIPE, depending on context). Programs that don't ignore SIPIPE and
programs that actually check output streams for errors will die.


How reproducible:
Always

Steps to Reproduce:
pxe-0.1-22 (from RH7.1, rebuilt for RH6.2) demonstrates this problem.
I

Actual Results:  It starts happily enough, and dies after it has been used
for a while.


Additional info:
Comment 1 Bill Nottingham 2001-06-28 15:52:03 EDT
Why is it trying to write to stdout/stderr after it's backgrounded itself?
It sounds like the daemon is broken.
Comment 2 peter.benie 2001-06-29 05:59:36 EDT
I'm half in agreement with you, and if you want to reassign this bug to the pxe
package then go ahead.

However, I doubt that pxe is unique in that it uses output streams after
daemonizing. The only other example that I can think of right now is xdm (which
RH doesn't start via initlog, thus avoiding this problem), but I would be amazed
if there weren't others too. 

The reason I'm not completely convinced that initlog is right to exit is that
some libraries (including libc) occasionally write diagnostic output to stderr.
This output being is the program's control. On most systems, you end up with
output on the console (fairly harmless). With RH, the daemon dies unexpectedly.
A common workaround is for daemons to redirect stdout and stderr to /dev/null,
but delibrately throwing away diagnostic output is rather unhelpful.
Comment 3 Bill Nottingham 2005-02-15 15:55:45 EST
Closing out bugs on older, no longer supported, releases.

initlog is no longer in the current devel tree, so it is unlikely to change.

Note You need to log in before you can comment on or make changes to this bug.