I'm using latest version of CentOS 7 and using this as an HAProxy box. Right now I can only start HAproxy via command line i.e.
Code: Select all
sudo /usr/sbin/haproxy -f /etc/haproxy/haproxy.cfg
If I try
Code: Select all
sudo systemclt start haproxy
Code: Select all
May 02 10:19:40 haproxy1 haproxy[4334]: | While not properly invalid, you will certainly encounter various problems
May 02 10:19:40 haproxy1 haproxy[4334]: | with such a configuration. To fix this, please ensure that all following
May 02 10:19:40 haproxy1 haproxy[4334]: | timeouts are set to a non-zero value: 'client', 'connect', 'server'.
May 02 10:19:40 haproxy1 haproxy[4334]: [WARNING] 121/101940 (4334) : config : 'stats' statement ignored for proxy 'sm... mode.
May 02 10:19:40 haproxy1 haproxy[4334]: [ALERT] 121/101940 (4334) : Starting proxy smtp: cannot bind socket [0.0.0.0:25]
May 02 10:19:40 haproxy1 systemd[1]: haproxy.service: main process exited, code=exited, status=1/FAILURE
May 02 10:19:40 haproxy1 systemd[1]: Unit haproxy.service entered failed state.
The HAProxy startup script looks like this:
Code: Select all
[Unit]
Description=HAProxy Load Balancer
After=syslog.target network.target
[Service]
ExecStart=/usr/sbin/haproxy-systemd-wrapper -f /etc/haproxy/haproxy.cfg -p /run/haproxy.pid
ExecReload=/bin/kill -USR2 $MAINPID
[Install]
WantedBy=multi-user.target
I also changed it to this to try to make the service run just like the command line
Code: Select all
[Unit]
Description=HAProxy Load Balancer
After=syslog.target network.target
[Service]
ExecStart=/usr/sbin/haproxy -f /etc/haproxy/haproxy.cfg -p /run/haproxy.pid
ExecReload=/bin/kill -USR2 $MAINPID
user=root
group=root
[Install]
WantedBy=multi-user.target
No matter what the systemctl method is unable to bind the port - seems like a permissions issue to me.