Note: This bug is displayed in read-only format because the product is no longer active in Red Hat Bugzilla.
RHEL Engineering is moving the tracking of its product development work on RHEL 6 through RHEL 9 to Red Hat Jira (issues.redhat.com). If you're a Red Hat customer, please continue to file support cases via the Red Hat customer portal. If you're not, please head to the "RHEL project" in Red Hat Jira and file new tickets here. Individual Bugzilla bugs in the statuses "NEW", "ASSIGNED", and "POST" are being migrated throughout September 2023. Bugs of Red Hat partners with an assigned Engineering Partner Manager (EPM) are migrated in late September as per pre-agreed dates. Bugs against components "kernel", "kernel-rt", and "kpatch" are only migrated if still in "NEW" or "ASSIGNED". If you cannot log in to RH Jira, please consult article #7032570. That failing, please send an e-mail to the RH Jira admins at rh-issues@redhat.com to troubleshoot your issue as a user management inquiry. The email creates a ServiceNow ticket with Red Hat. Individual Bugzilla bugs that are migrated will be moved to status "CLOSED", resolution "MIGRATED", and set with "MigratedToJIRA" in "Keywords". The link to the successor Jira issue will be found under "Links", have a little "two-footprint" icon next to it, and direct you to the "RHEL project" in Red Hat Jira (issue links are of type "https://issues.redhat.com/browse/RHEL-XXXX", where "X" is a digit). This same link will be available in a blue banner at the top of the page informing you that that bug has been migrated.

Bug 1477907

Summary: Configuration reload (SIGHUP) opens two (never closed) new pipes in subprocess [rhel-7.3.z]
Product: Red Hat Enterprise Linux 7 Reporter: Oneata Mircea Teodor <toneata>
Component: keepalivedAssignee: Ryan O'Hara <rohara>
Status: CLOSED ERRATA QA Contact: Brandon Perkins <bperkins>
Severity: urgent Docs Contact:
Priority: urgent    
Version: 7.3CC: cfeist, cluster-maint, igkioka, rohara, salmy, toneata, yann.morice
Target Milestone: rcKeywords: Regression, ZStream
Target Release: ---   
Hardware: x86_64   
OS: Linux   
Whiteboard:
Fixed In Version: keepalived-1.2.13-9.el7_3.1 Doc Type: Bug Fix
Doc Text:
Previously, open pipes were not closed properly when the keepalived process received the SIGHUP signal. As a consequence, every time keepalived received SIGHUP, two new pipes were created while the existing pipes were not closed. This bug has been fixed by using the pipe2() system call with the O_CLOEXEC flag. As a result, the number of open pipes no longer grows with every SIGHUP signal.
Story Points: ---
Clone Of: 1464869 Environment:
Last Closed: 2018-01-25 12:58:25 UTC Type: ---
Regression: --- Mount Type: ---
Documentation: --- CRM:
Verified Versions: Category: ---
oVirt Team: --- RHEL 7.3 requirements from Atomic Host:
Cloudforms Team: --- Target Upstream Version:
Embargoed:
Bug Depends On: 1464869    
Bug Blocks:    

Description Oneata Mircea Teodor 2017-08-03 07:51:44 UTC
This bug has been copied from bug #1464869 and has been proposed to be backported to 7.3 z-stream (EUS).

Comment 3 Oneata Mircea Teodor 2017-08-03 07:52:53 UTC
*** Bug 1477883 has been marked as a duplicate of this bug. ***

Comment 4 Ryan O'Hara 2017-08-03 15:20:53 UTC
The fix here is two-part:

1. Add "@DEFS@" to the DEFS in lib/Makefile.in such that the HAVE_PIPE2 is used correctly at build time.

2. Add back a few lines of code that were removed in #1429880. Specifically, the code in signal_handler_destroy():

--      close(signal_pipe[1]);
--      close(signal_pipe[0]);
--      signal_pipe[1] = -1;
--      signal_pipe[0] = -1;

Comment 5 Ryan O'Hara 2017-08-03 15:36:42 UTC
Test results:

# rpm -q keepalived
keepalived-1.2.13-9.el7_3.1.x86_64

# keepalived -f /etc/keepalived/keepalived.conf 
# pstree -p $( cat /var/run/keepalived.pid )
keepalived(34937)─┬─keepalived(34938)
                                 └─keepalived(34939)

# lsof | grep 34937 | grep pipe | wc -l
2
# lsof | grep 34938 | grep pipe | wc -l
2
# lsof | grep 34939 | grep pipe | wc -l
2

# kill -HUP $( cat /var/run/keepalived.pid )

# lsof | grep 34937 | grep pipe | wc -l
2
# lsof | grep 34938 | grep pipe | wc -l
2
# lsof | grep 34939 | grep pipe | wc -l
2

Note that after SIGHUP each process should have exactly 2 pipes open. This is correct.

Comment 12 errata-xmlrpc 2018-01-25 12:58:25 UTC
Since the problem described in this bug report should be
resolved in a recent advisory, it has been closed with a
resolution of ERRATA.

For information on the advisory, and where to find the updated
files, follow the link below.

If the solution does not work for you, open a new bug report.

https://access.redhat.com/errata/RHBA-2018:0183