# Systemctl script for RHEL 7.x

**URL:** <https://discourse.haproxy.org/t/systemctl-script-for-rhel-7-x/737>\
**Category:** Help!\
**Created:** [October 18, 2016, 5:02pm UTC](https://discourse.haproxy.org/t/systemctl-script-for-rhel-7-x/737 "2016-10-18T17:02:44Z")\
**Posts on this page:** 1\
**Page:** 1

<div class="post-metadata">

**Author:** ![kotarusv](https://avatars.discourse-cdn.com/v4/letter/k/b19c9b/32.png) [@kotarusv](https://discourse.haproxy.org/u/kotarusv)\
**Post date:** [October 18, 2016, 5:02pm UTC](https://discourse.haproxy.org/t/systemctl-script-for-rhel-7-x/737/1 "2016-10-18T17:02:44Z")

</div>

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](mailto: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
