Bug 471591 - echo: write error: Broken pipe in %post
Summary: echo: write error: Broken pipe in %post
Keywords:
Status: CLOSED ERRATA
Alias: None
Product: Red Hat Enterprise Linux 5
Classification: Red Hat
Component: rpm
Version: 5.3
Hardware: All
OS: Linux
high
high
Target Milestone: rc
: ---
Assignee: Panu Matilainen
QA Contact: BaseOS QE
URL:
Whiteboard:
Depends On:
Blocks: 468087
TreeView+ depends on / blocked
 
Reported: 2008-11-14 15:01 UTC by Olivier Fourdan
Modified: 2018-10-20 02:17 UTC (History)
6 users (show)

Fixed In Version:
Doc Type: Bug Fix
Doc Text:
Clone Of:
Environment:
Last Closed: 2009-01-20 20:48:22 UTC
Target Upstream Version:
Embargoed:


Attachments (Terms of Use)
source of an rpm package that exhibits the problem (3.62 KB, application/x-rpm)
2008-11-14 15:01 UTC, Olivier Fourdan
no flags Details


Links
System ID Private Priority Status Summary Last Updated
Red Hat Product Errata RHBA-2009:0079 0 normal SHIPPED_LIVE rpm bug fix update 2009-01-20 16:04:16 UTC

Description Olivier Fourdan 2008-11-14 15:01:05 UTC
Created attachment 323585 [details]
source of an rpm package that exhibits the problem

Description of problem:

Using a program that forks/pipe in %post can break all echo commands from the %post install scriptlet.

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

rpm-4.4.2.3-7.el5

How reproducible:

100% with attached reproducer

Steps to Reproduce:
1. Download and build attached reproducer
2. install with rpm -ivh test-rh-1.0.0-1.ia64.rpm
  
Actual results:

# rpm -ivh test-rh-1.0.0-1.ia64.rpm
Preparing...                ########################################### [100%]
   1:test-rh                ########################################### [100%]
# /etc/init.d/functions: line 398: echo: write error: Broken pipe
/etc/init.d/functions: line 400: echo: write error: Broken pipe
/etc/init.d/functions: line 402: echo: write error: Broken pipe
/etc/init.d/functions: line 403: echo: write error: Broken pipe
/etc/init.d/snmpd: line 34: echo: write error: Broken pipe


Expected results:

# rpm -ivh test-rh-1.0.0-1.ia64.rpm
Preparing...                ########################################### [100%]
   1:test-rh                ########################################### [100%]

Additional info:

The %post calls a script that run a program that runs "/sbin/service snmpd start" in the background with a pipe. But the program does not wait for child completion, so when the service script does its echo, the parent is gone and the pipe with it, leading to the "broken pipe" error.

While the problem can be fixed in the program by either handling SIGPIPE or waiting for the child completion with wait(), the customer sees this as a regression because previous versions of rpm would handle this silently.

Comment 1 Panu Matilainen 2008-11-16 09:43:13 UTC
Thanks for the reproducer. This is an unwanted side-effect from switching to NSS for crypto. NSPR (which NSS uses underneath) quietly sets SIG_IGN on SIGPIPE for whatever reason. Another similar case is bug 444389 (which is relevant for RHEL 5.3 too)

Fixing is just a matter of flipping SIGPIPE back to default handler for execution of scriptlets and such.

Comment 4 Panu Matilainen 2008-11-19 06:56:08 UTC
Fix built into rpm-4.4.2.3-8.el5

Comment 8 Issue Tracker 2008-12-05 03:04:03 UTC
From Fujitsu:
---
We confirmed that the fix is included in RHEL5.3 beta snapshot 4.
Thank you very much!
---
So PartnerVerified! Thanks!



This event sent from IssueTracker by moshiro 
 issue 234705

Comment 10 errata-xmlrpc 2009-01-20 20:48:22 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 therefore 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-2009-0079.html


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