Systemctl script for RHEL 7.x


#1

Hi

I’m having 2 issues with below systemctl script with RHEL 7.X

  1. I’m seeing below error frequently in systemctl status haproxy-80 or 443 instance

systemd[1]: [/etc/systemd/system/haproxy-80.service:11] Failed to parse kill mode, ignoring: mixed
systemd[1]: [/etc/systemd/system/haproxy-80.service:11] Failed to parse kill mode, ignoring: mixed
systemd[1]: [/etc/systemd/system/haproxy-80.service:11] Failed to parse kill mode, ignoring: mixed
systemd[1]: [/etc/systemd/system/haproxy-80.service:11] Failed to parse kill mode, ignoring: mixed

  1. More importantly, after few days HAPROXY unable respond and health checks are failing. I am pretty sure backend is working fine. restarting the haproxy immediately fixing the issue. There is no pattern but it has been happening very frequently. As always, restarting haproxy resolving the issue immediately

I am using a self compiled version of haproxy and below are compiled flags

HA-Proxy version 1.6.8 2016/08/14
Copyright 2000-2016 Willy Tarreau willy@haproxy.org

Build options :
TARGET = linux2628
CPU = native
CC = gcc
CFLAGS = -O2 -march=native -g -fno-strict-aliasing -Wdeclaration-after-statement
OPTIONS = USE_LIBCRYPT=1 USE_ZLIB=yes USE_OPENSSL=1 USE_STATIC_PCRE=1

Default settings :
maxconn = 2000, bufsize = 16384, maxrewrite = 1024, maxpollevents = 200

Encrypted password support via crypt(3): yes
Built with zlib version : 1.2.7
Compression algorithms supported : identity(“identity”), deflate(“deflate”), raw-deflate(“deflate”), gzip(“gzip”)
Built with OpenSSL version : OpenSSL 1.0.2h 3 May 2016
Running on OpenSSL version : OpenSSL 1.0.2h 3 May 2016
OpenSSL library supports TLS extensions : yes
OpenSSL library supports SNI : yes
OpenSSL library supports prefer-server-ciphers : yes
Built with PCRE version : 8.32 2012-11-30
PCRE library supports JIT : no (USE_PCRE_JIT not set)
Built without Lua support
Built with transparent proxy support using: IP_TRANSPARENT IPV6_TRANSPARENT IP_FREEBIND

Available polling systems :
epoll : pref=300, test result OK
poll : pref=200, test result OK
select : pref=150, test result OK
Total: 3 (3 usable), will use epoll.

My systemctl startup script

cat /etc/systemd/system/haproxy-80.service
[Unit]
Description=HAProxy Load Balancer
After=syslog.target network.target

[Service]
Environment=“CONFIG=/opt/haproxy/haproxy-80/conf/haproxy.conf” "PIDFILE=/run/haproxy-80.pid"
ExecStartPre=/opt/haproxy/haproxy-80/sbin/haproxy-80 -f $CONFIG -c -q
ExecStart=/opt/haproxy/haproxy-80/sbin/haproxy-80-systemd-wrapper -f $CONFIG -p $PIDFILE
ExecReload=/opt/haproxy/haproxy-80/sbin/haproxy-80 -f $CONFIG -c -q
ExecReload=/bin/kill -USR2 $MAINPID
KillMode=mixed
Restart=always
StandardOutput=syslog
StandardError=syslog
SyslogIdentifier=haproxy-80
Environment=NODE_ENV=production

[Install]
WantedBy=multi-user.target

.i am running 80 and 443 instances separately thus. binaries are shared but using different configuration files.

Can you confirm above systemctl startup script is valid ?

Srinivas Kotaru