Created
June 11, 2025 16:31
-
-
Save obervinov/0cb76fd303953f8c7f2d81f4030b9300 to your computer and use it in GitHub Desktop.
Systemd for haproxy
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
# /etc/systemd/system/haproxy.service | |
[Unit] | |
Description=HAProxy Load Balancer | |
After=network.target | |
[Service] | |
Environment="CONFIG=/etc/haproxy/haproxy.cfg" "PIDFILE=/var/run/haproxy.pid" | |
ExecStartPre=/usr/sbin/haproxy -f $CONFIG -c -q | |
ExecStart=/usr/sbin/haproxy -Ws -f $CONFIG -p $PIDFILE -d | |
ExecReload=/usr/sbin/haproxy -f $CONFIG -c -q | |
ExecReload=/bin/kill -USR2 $MAINPID | |
KillMode=mixed | |
Restart=always | |
SuccessExitStatus=143 | |
Type=notify | |
[Install] | |
WantedBy=multi-user.target |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment