Bug 1778844

Summary: haproxy status failed after stopping the service
Product: Red Hat Enterprise Linux 8 Reporter: Jeremy Harris <jeharris>
Component: haproxyAssignee: Ryan O'Hara <rohara>
Status: CLOSED ERRATA QA Contact: Brandon Perkins <bperkins>
Severity: medium Docs Contact:
Priority: unspecified    
Version: 8.1CC: rohara
Target Milestone: rcKeywords: Regression
Target Release: 8.0Flags: pm-rhel: mirror+
Hardware: Unspecified   
OS: Unspecified   
Whiteboard:
Fixed In Version: haproxy-1.8.23-2.el8 Doc Type: If docs needed, set a value
Doc Text:
Story Points: ---
Clone Of: Environment:
Last Closed: 2020-04-28 16:03:37 UTC Type: Bug
Regression: --- Mount Type: ---
Documentation: --- CRM:
Verified Versions: Category: ---
oVirt Team: --- RHEL 7.3 requirements from Atomic Host:
Cloudforms Team: --- Target Upstream Version:
Embargoed:

Description Jeremy Harris 2019-12-02 16:04:16 UTC
This is an effective clone of bz 1444709; the same syptom being seen for 8.1
as that bug had for 7.3 :-

# systemctl status haproxy.service
● haproxy.service - HAProxy Load Balancer
   Loaded: loaded (/usr/lib/systemd/system/haproxy.service; disabled; vendor preset: disabled)
   Active: failed (Result: exit-code) since Thu 2019-11-28 10:38:15 JST; 4h 13min ago
  Process: 8403 ExecStart=/usr/sbin/haproxy -Ws -f $CONFIG -p $PIDFILE (code=exited, status=143)
  Process: 8402 ExecStartPre=/usr/sbin/haproxy -f $CONFIG -c -q (code=exited, status=0/SUCCESS)
 Main PID: 8403 (code=exited, status=143)

11月 28 10:38:00 lb11 systemd[1]: Starting HAProxy Load Balancer...
11月 28 10:38:00 lb11 systemd[1]: Started HAProxy Load Balancer.
11月 28 10:38:15 lb11 systemd[1]: Stopping HAProxy Load Balancer...
11月 28 10:38:15 lb11 haproxy[8403]: [WARNING] 331/103800 (8403) : Exiting Master process...
11月 28 10:38:15 lb11 haproxy[8403]: [ALERT] 331/103800 (8403) : Current worker 8405 exited with code 143
11月 28 10:38:15 lb11 haproxy[8403]: [WARNING] 331/103800 (8403) : All workers exited. Exiting... (143)
11月 28 10:38:15 lb11 systemd[1]: haproxy.service: Main process exited, code=exited, status=143/n/a
11月 28 10:38:15 lb11 systemd[1]: haproxy.service: Failed with result 'exit-code'.
11月 28 10:38:15 lb11 systemd[1]: Stopped HAProxy Load Balancer.

Comment 1 Ryan O'Hara 2019-12-02 16:32:00 UTC
Not sure this is the same thing as bz 1444709. That bug was fixed by using KillMode=mixed in the systemd service file. RHEL8 definitely uses KillMode=mixed.

Comment 2 Ryan O'Hara 2019-12-03 18:24:33 UTC
Found something interesting in the upstream systemd service file:

----

[Unit]
Description=HAProxy Load Balancer
After=network.target

[Service]
Environment="CONFIG=/etc/haproxy/haproxy.cfg" "PIDFILE=/run/haproxy.pid"
ExecStartPre=@SBINDIR@/haproxy -f $CONFIG -c -q
ExecStart=@SBINDIR@/haproxy -Ws -f $CONFIG -p $PIDFILE
ExecReload=@SBINDIR@/haproxy -f $CONFIG -c -q
ExecReload=/bin/kill -USR2 $MAINPID
KillMode=mixed
Restart=always
SuccessExitStatus=143
Type=notify

----

Note the "SuccessExitStatus=143" line. That is exactly the exit status shown above. I added this line to the service file and reloaded. Seems to fix it.

Comment 8 errata-xmlrpc 2020-04-28 16:03:37 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/RHSA-2020:1725