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 1396219

Summary: Haproxy systemd wrapper reports wrong exit codes to systemd
Product: Red Hat Enterprise Linux 7 Reporter: Tom Lavigne <tlavigne>
Component: haproxyAssignee: Ryan O'Hara <rohara>
Status: CLOSED ERRATA QA Contact: Udi Shkalim <ushkalim>
Severity: urgent Docs Contact:
Priority: urgent    
Version: 7.0CC: bperkins, cfeist, fdinitto, gcerami, lkimlick, michele, rohara, ushkalim, vcojot
Target Milestone: rcKeywords: ZStream
Target Release: ---   
Hardware: Unspecified   
OS: Unspecified   
Whiteboard:
Fixed In Version: haproxy-1.5.18-3.el7_3.1 Doc Type: If docs needed, set a value
Doc Text:
Previously, the haproxy-systemd-wrapper reported an incorrect exit status when the haproxy server failed to start. For example, when the haproxy server attempted to bind a port that was already in use, the haproxy-systemd-wrapper incorrectly returned a zero exit status, indicating success. This bug has been fixed, and haproxy-systemd-wrapper now correctly reports an error when the haproxy server fails to start.
Story Points: ---
Clone Of: 1391990 Environment:
Last Closed: 2016-12-08 17:16:35 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: 1391990, 1500968, 1500969, 1501527    
Bug Blocks:    

Description Tom Lavigne 2016-11-17 18:10:11 UTC
This bug has been copied from bug #1391990 and has been proposed
to be backported to 7.3 z-stream (EUS).

Comment 4 Udi Shkalim 2016-11-21 17:19:11 UTC
Verified on haproxy-1.5.18-3.el7_3.1.x86_64


Before:
[root@controller-1 ~]# nc -l 80 &
[root@controller-1 ~]# /usr/sbin/haproxy-systemd-wrapper -f /etc/haproxy/haproxy.cfg -p /run/haproxy.pid
<7>haproxy-systemd-wrapper: executing /usr/sbin/haproxy -f /etc/haproxy/haproxy.cfg -p /run/haproxy.pid -Ds 
[ALERT] 325/170731 (19855) : Starting proxy horizon: cannot bind socket [10.0.0.101:80]
[ALERT] 325/170731 (19855) : Starting proxy horizon: cannot bind socket [172.17.1.11:80]
<5>haproxy-systemd-wrapper: exit, haproxy RC=256
[root@controller-1 ~]# echo $?
0

After the fix:
[root@controller-1 ~]# /usr/sbin/haproxy-systemd-wrapper -f /etc/haproxy/haproxy.cfg -p /run/haproxy.pid
<7>haproxy-systemd-wrapper: executing /usr/sbin/haproxy -f /etc/haproxy/haproxy.cfg -p /run/haproxy.pid -Ds 
[ALERT] 325/171629 (20239) : Starting proxy horizon: cannot bind socket [10.0.0.101:80]
[ALERT] 325/171629 (20239) : Starting proxy horizon: cannot bind socket [172.17.1.11:80]
<5>haproxy-systemd-wrapper: exit, haproxy RC=1
[root@controller-1 ~]# echo $?
1

Comment 6 errata-xmlrpc 2016-12-08 17:16:35 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://rhn.redhat.com/errata/RHBA-2016-2931.html