blob: 05fc595796c479b444a804119235388142decab9 [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"
Apollon Oikonomopoulosb0601482019-05-06 13:00:52 +020010ExecStartPre=@SBINDIR@/haproxy -f $CONFIG -c -q $EXTRAOPTS
11ExecStart=@SBINDIR@/haproxy -Ws -f $CONFIG -p $PIDFILE $EXTRAOPTS
12ExecReload=@SBINDIR@/haproxy -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