blob: 49d3c52cf1c1d2e83ca6fc6c9eb4fc9f7138aca5 [file] [log] [blame]
Marc-Antoine Perennouf8255802013-02-13 09:28:50 +01001[Unit]
2Description=HAProxy Load Balancer
Ryan O'Haraf49a6042020-06-15 11:34:54 -05003After=network-online.target
4Wants=network-online.target
Marc-Antoine Perennouf8255802013-02-13 09:28:50 +01005
6[Service]
Apollon Oikonomopoulosb0601482019-05-06 13:00:52 +02007EnvironmentFile=-/etc/default/haproxy
William Lallemandeaa45552019-05-07 14:00:33 +02008EnvironmentFile=-/etc/sysconfig/haproxy
Tim Duesterhuseaa4b8a2019-05-06 13:00:53 +02009Environment="CONFIG=/etc/haproxy/haproxy.cfg" "PIDFILE=/run/haproxy.pid" "EXTRAOPTS=-S /run/haproxy-master.sock"
William Lallemand0857f962021-08-20 23:29:53 +020010ExecStartPre=@SBINDIR@/haproxy -Ws -f $CONFIG -c -q $EXTRAOPTS
Apollon Oikonomopoulosb0601482019-05-06 13:00:52 +020011ExecStart=@SBINDIR@/haproxy -Ws -f $CONFIG -p $PIDFILE $EXTRAOPTS
William Lallemanddd8bec32021-07-26 11:03:54 +020012ExecReload=@SBINDIR@/haproxy -Ws -f $CONFIG -c -q $EXTRAOPTS
Marc-Antoine Perennouf8255802013-02-13 09:28:50 +010013ExecReload=/bin/kill -USR2 $MAINPID
Apollon Oikonomopoulos74f01692014-10-08 15:14:41 +030014KillMode=mixed
Marc-Antoine Perennouf8255802013-02-13 09:28:50 +010015Restart=always
Vincent Bernat3b479bd2018-06-22 20:57:03 +020016SuccessExitStatus=143
Tim Duesterhusd6942c82017-11-20 15:58:35 +010017Type=notify
Marc-Antoine Perennouf8255802013-02-13 09:28:50 +010018
Tim Duesterhus1ce8de22018-02-27 20:19:03 +010019# The following lines leverage SystemD's sandboxing options to provide
20# defense in depth protection at the expense of restricting some flexibility
21# in your setup (e.g. placement of your configuration files) or possibly
22# reduced performance. See systemd.service(5) and systemd.exec(5) for further
23# information.
24
Tim Duesterhus8a965922018-02-27 20:19:04 +010025# NoNewPrivileges=true
26# ProtectHome=true
27# If you want to use 'ProtectSystem=strict' you should whitelist the PIDFILE,
28# any state files and any other files written using 'ReadWritePaths' or
29# 'RuntimeDirectory'.
30# ProtectSystem=true
31# ProtectKernelTunables=true
32# ProtectKernelModules=true
33# ProtectControlGroups=true
Tim Duesterhus2788a392018-02-27 20:19:05 +010034# If your SystemD version supports them, you can add: @reboot, @swap, @sync
35# SystemCallFilter=~@cpu-emulation @keyring @module @obsolete @raw-io
Tim Duesterhus8a965922018-02-27 20:19:04 +010036
Marc-Antoine Perennouf8255802013-02-13 09:28:50 +010037[Install]
38WantedBy=multi-user.target