The best approach to resolve this privilege issue is to run these specific commands:
- Set the correct capabilities on haproxy:
setcap cap_net_raw,cap_net_admin,cap_net_bind_service+eip /usr/sbin/haproxy
- Adjust the permissions on the
haproxy.pid file:
touch /var/run/haproxy.pid; chown haproxy:haproxy /var/run/haproxy.pid
- Comment out the user and group definitions in
haproxy.conf:
User haproxy
Group haproxy
- Start the daemon running as the
haproxy user:
sudo -u haproxy /sbin/haproxy -f /etc/haproxy/haproxy.cfg -p /var/run/haproxy.pid -D -q
- Verify the haproxy process is running:
ps -ef | grep haproxy
You should see output like this:
haproxy 12800 1 0 фев12 ? 00:00:58 /sbin/haproxy -f /etc/haproxy/haproxy.cfg -p /var/run/haproxy.pid -D -q
To make haproxy start automatically, you can add these commands to your /etc/rc.local file.