Bug 1396219 - Haproxy systemd wrapper reports wrong exit codes to systemd
Summary: Haproxy systemd wrapper reports wrong exit codes to systemd
Keywords:
Status: CLOSED ERRATA
Alias: None
Product: Red Hat Enterprise Linux 7
Classification: Red Hat
Component: haproxy
Version: 7.0
Hardware: Unspecified
OS: Unspecified
urgent
urgent
Target Milestone: rc
: ---
Assignee: Ryan O'Hara
QA Contact: Udi Shkalim
URL:
Whiteboard:
Depends On: 1391990 1500968 1500969 1501527
Blocks:
TreeView+ depends on / blocked
 
Reported: 2016-11-17 18:10 UTC by Tom Lavigne
Modified: 2017-10-13 14:49 UTC (History)
9 users (show)

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.
Clone Of: 1391990
Environment:
Last Closed: 2016-12-08 17:16:35 UTC
Target Upstream Version:


Attachments (Terms of Use)


Links
System ID Private Priority Status Summary Last Updated
Red Hat Product Errata RHBA-2016:2931 0 normal SHIPPED_LIVE haproxy bug fix update 2016-12-08 22:16:19 UTC

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


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