OPNsense Forum

English Forums => Web Proxy Filtering and Caching => Topic started by: deepblue on October 12, 2020, 06:51:31 PM

Title: HAProxy Service not starting
Post by: deepblue on October 12, 2020, 06:51:31 PM
Hello,

I'm used to HAProxy (cli) but here I'm facing a problem with HAProxy plugin.

The service just won't start.

All the required elements looks filled in correctly (servers, backend, frontend, conditions, rules).
The syntax check is good but in the dashboard I still have the red service indicator for HAProxy.

sockat | grep haproxy doesn't return anything.

The most surprising thing is that the haproxy.cfg doesn't exist, is this normal?
ls: /usr/local/etc/haproxy.cfg: No such file or directory

Also I can't find any logs to help me.

Any idea what could I've done wrong or what could I check?

edit: Some element that can help
root@test:~ # /usr/local/etc/rc.d/haproxy onestart
/usr/local/etc/rc.d/haproxy: WARNING: /usr/local/etc/haproxy.conf is not readable.
/usr/local/etc/rc.d/haproxy: WARNING: failed precmd routine for haproxy
Title: Re: HAProxy Service not starting
Post by: sorano on October 13, 2020, 11:26:18 AM
What happens if you just touch /usr/local/etc/haproxy.conf then re-apply your haproxy settings from webui?
Title: Re: HAProxy Service not starting
Post by: deepblue on October 13, 2020, 03:20:33 PM
I tried it already but same result. The diffenrece now is that when I launch haproxy with cli, there is no haproxy.cfg error, but only the warning.

root@test:~ # /usr/local/etc/rc.d/haproxy onestart
/usr/local/etc/rc.d/haproxy: WARNING: failed precmd routine for haproxy


edit: launching with start option tells me that haproxy is not enabled (but it is enable in GUI settings)
root@test:~ # /usr/local/etc/rc.d/haproxy start
Cannot 'start' haproxy. Set haproxy_enable to YES in /etc/rc.conf or use 'onestart' instead of 'start'.


edit2: It definitely looks like an enabled service problem
If I manually says in /usr/local/etc/rc.d/haproxy that haproxy is enabled, I can that the service from command line and from GUI (in GUI it freeze on loading page after clicking on start service but if I refresh I can see the service green).