Why HAProxy service fails to start when SELinux is in 'Enforcing' mode ?
Issue
- When an additional port is added under
listen
directive, the HAProxy service will not restart successfully. - At times even with single
IP:Port
combination the HAProxy service will fail to start with below error;
Oct 25 13:57:01 HOSTNAME haproxy-systemd-wrapper[7034]: [ALERT] 297/135701 (7035) : Starting frontend FRONTEND-NAME: cannot bind socket [0.0.0.0:7999]
Oct 25 13:57:01 HOSTNAME haproxy-systemd-wrapper[7034]: haproxy-systemd-wrapper: exit, haproxy RC=1
Oct 25 13:57:01 HOSTNAME systemd[1]: haproxy.service: main process exited, code=exited, status=1/FAILURE
Oct 25 13:57:01 HOSTNAME systemd[1]: Unit haproxy.service entered failed state.
Oct 25 13:57:01 HOSTNAME systemd[1]: haproxy.service failed.
Environment
- Red Hat Enterprise Linux 7
- HAProxy
- SELinux
Subscriber exclusive content
A Red Hat subscription provides unlimited access to our knowledgebase, tools, and much more.