Bug 163483 - rhnsd spawns children with SIGPIPE set to SIG_IGN
Summary: rhnsd spawns children with SIGPIPE set to SIG_IGN
Keywords:
Status: CLOSED ERRATA
Alias: None
Product: Red Hat Enterprise Linux 4
Classification: Red Hat
Component: up2date
Version: 4.0
Hardware: All
OS: Linux
medium
medium
Target Milestone: ---
: ---
Assignee: Bryan Kearney
QA Contact: Corey Welton
URL:
Whiteboard:
Depends On:
Blocks: 191074 191079 218651
TreeView+ depends on / blocked
 
Reported: 2005-07-18 08:10 UTC by Kjetil T. Homme
Modified: 2013-01-10 08:48 UTC (History)
1 user (show)

Fixed In Version: RHBA-2007-0250
Doc Type: Bug Fix
Doc Text:
Clone Of:
Environment:
Last Closed: 2007-05-01 22:59:25 UTC
Target Upstream Version:
Embargoed:


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


Links
System ID Private Priority Status Summary Last Updated
Red Hat Product Errata RHBA-2007:0250 0 normal SHIPPED_LIVE up2date bug fix update 2007-04-28 17:55:33 UTC

Description Kjetil T. Homme 2005-07-18 08:10:44 UTC
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 08:37:39 UTC
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-11 00:29:35 UTC
Blocking rhnupr4u4 and rhnupr3u8 to track the progress of the release

Comment 4 Fanny Augustin 2006-04-13 19:30:53 UTC
Moving bugs to the CanFix List

Comment 5 Fanny Augustin 2006-05-08 19:10:42 UTC
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 20:05:20 UTC
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 15:29:02 UTC
Created attachment 134646 [details]
Test program

Comment 10 James Bowes 2006-08-22 15:33:17 UTC
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 17:17:06 UTC
Fixed in up2date-4.5.0-1

Comment 13 Corey Welton 2007-03-21 17:58:24 UTC
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 14:30:55 UTC
(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 19:04:20 UTC
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 22:59:25 UTC
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 14:35:18 UTC
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.