Bug 163483 - rhnsd spawns children with SIGPIPE set to SIG_IGN
rhnsd spawns children with SIGPIPE set to SIG_IGN
Status: CLOSED ERRATA
Product: Red Hat Enterprise Linux 4
Classification: Red Hat
Component: up2date (Show other bugs)
4.0
All Linux
medium Severity medium
: ---
: ---
Assigned To: Bryan Kearney
Corey Welton
:
Depends On:
Blocks: 191074 191079 218651
  Show dependency treegraph
 
Reported: 2005-07-18 04:10 EDT by Kjetil T. Homme
Modified: 2013-01-10 03:48 EST (History)
1 user (show)

See Also:
Fixed In Version: RHBA-2007-0250
Doc Type: Bug Fix
Doc Text:
Story Points: ---
Clone Of:
Environment:
Last Closed: 2007-05-01 18:59:25 EDT
Type: ---
Regression: ---
Mount Type: ---
Documentation: ---
CRM:
Verified Versions:
Category: ---
oVirt Team: ---
RHEL 7.3 requirements from Atomic Host:
Cloudforms Team: ---


Attachments (Terms of Use)
Test program (407 bytes, text/plain)
2006-08-22 11:29 EDT, James Bowes
no flags Details

  None (edit)
Description Kjetil T. Homme 2005-07-18 04:10:44 EDT
From Bugzilla Helper:
User-Agent: Mozilla/5.0 (X11; U; Linux i686; en-US; rv:1.7.8) Gecko/20050513

Description of problem:
one of the first things rhnsd does, is to
    signal (SIGPIPE, SIG_IGN);

this is never reverted later.  this causes children to be launched with an unexpected environment where SIGPIPE doesn't cause immediate death, but rather a failed write system call.

the effect of this can be quite puzzling.  in bug 146849 vixie-cron was restarted in this mode, and after that happens, the nightly makewhatis is prone to emit a lot of "zcat: stdout: Broken pipe".  in our case we received 100K of such logs in e-mail from each of about a hundred workstations after the vixie-cron was updated on June 25th.


Version-Release number of selected component (if applicable):
up2date-4.2.57-2

How reproducible:
Didn't try

Steps to Reproduce:
I _have_ tried to reproduce it using a minimal spec file containing

%post
echo "postinstall"
trap
cat /bin/login | date
exit 0
# === end ===

this exonerated rpm itself.  unfortunately, I don't have my own up2date repository set up, and since the update has to go through rhnsd, there are a few steps to go through to verify.  the source code for rhnsd looks pretty clear to me, though.


Expected Results:  the %post scriptlet should give output similar to

postinstall
trap -- '' SIGPIPE
Mon Jul 18 10:09:29 CEST 2005
cat: write error: Broken pipe


Additional info:
Comment 1 Kjetil T. Homme 2005-07-18 04:37:39 EDT
using bash' trap builtin is not reliable.

# trap
trap -- '' SIGPIPE
# bash --noprofile -c 'trap' </dev/null
(nothing)

use the test program in bug 163484 instead.
Comment 3 Fanny Augustin 2006-04-10 20:29:35 EDT
Blocking rhnupr4u4 and rhnupr3u8 to track the progress of the release
Comment 4 Fanny Augustin 2006-04-13 15:30:53 EDT
Moving bugs to the CanFix List
Comment 5 Fanny Augustin 2006-05-08 15:10:42 EDT
This bug did not make the code freeze and it will not be fiixed during this
release cycle.  Re-aligning bug to the next release
Comment 6 Fanny Augustin 2006-05-08 16:05:20 EDT
This bug did not make the code freeze.  It will not be fixed in this releasee 
Reea ligning to the next one.
Comment 9 James Bowes 2006-08-22 11:29:02 EDT
Created attachment 134646 [details]
Test program
Comment 10 James Bowes 2006-08-22 11:33:17 EDT
The above test program will send the signal handler to syslog.

To test this bug, compile the test program, and copy it to /usr/sbin/rhn_check

With the current rhnsd, SIG_IGN will be printed to /var/log/messages.
With the updated version, SIG_DFL will appear instead.
Comment 11 James Bowes 2006-11-09 12:17:06 EST
Fixed in up2date-4.5.0-1
Comment 13 Corey Welton 2007-03-21 13:58:24 EDT
It appears that the test and/or script above is invalid.

* On a system w/ up2date < 4.5.0-1:

[root@fjs-0-17 sbin]# rpm -qa |grep up2date
up2date-4.4.5-1
up2date-4.4.69-25
[root@fjs-0-17 sbin]# /usr/sbin/rhn_check
SIG_DFL

* On a system w/ up2date >= 4.5.0-1:

[root@rlx-3-08 sbin]# rpm -qa|grep up2date
up2date-gnome-4.5.5-1.el4
up2date-4.5.5-1.el4
[root@rlx-3-08 sbin]# /usr/sbin/rhn_check
SIG_DFL


I am getting 'SIG_DFL' either way, even on the unpatched system.  Please advise.
Comment 14 James Bowes 2007-03-22 10:30:55 EDT
(In reply to comment #13)
> I am getting 'SIG_DFL' either way, even on the unpatched system.  Please advise.

Are you checking the results from rhn_checking getting executed by rhnsd (as in
comment #10), or just from running this dummy rhn_check on the command line?

Comment 15 Corey Welton 2007-03-23 15:04:20 EDT
QA Verified on i386 arch, but not yet others.  Will mark as verified when this
has been completed.
Comment 17 Red Hat Bugzilla 2007-05-01 18:59:25 EDT
An advisory has been issued which should help the problem
described in this bug report. This report is therefore being
closed with a resolution of ERRATA. For more information
on the solution and/or where to find the updated files,
please follow the link below. You may reopen this bug report
if the solution does not work for you.

http://rhn.redhat.com/errata/RHBA-2007-0250.html
Comment 18 wes hayutin 2007-05-16 10:35:18 EDT
May 16 10:32:59 dhcp231-70 rhnsd[13722]: Exiting
May 16 10:32:59 dhcp231-70 rhnsd: rhnsd shutdown succeeded
May 16 10:32:59 dhcp231-70 rhnsd[13746]: Red Hat Network Services Daemon
starting up.
May 16 10:33:52 dhcp231-70 sshd(pam_unix)[13749]: session opened for user root
by (uid=0)
May 16 10:34:28 dhcp231-70 rhn_check: SIG_DFL


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