Can't stop or restart haproxy 1.4.24 on pfsense 2.1



  • I installed a copy of pfSense v2.1 to load-balance a couple of web servers. I spent a good couple of hours thing to get the ACLs to work only to find out that the changes were not getting applied because the daemon was not getting restarted even though the webgui was telling me the opposite.

    I installed haproxy (default package, not devel) and set it up. The first time it ran without a hitch. But when I started to tweak the config I wasn't able to reload the changes.

    All I get in the logs is a single line saying:

    Jan  8 17:11:38 haproxy1 php: /status_services.php: The command '/usr/local/etc/rc.d/haproxy.sh stop' returned exit code '1', the output was 'haproxy not running?'
    

    And it is indeed running:

    [2.1-RELEASE][admin@haproxy1.localdomain]/var/log(15): ps auwgx | grep hapr
    www    48763  0.0  0.9 10516  2156  ??  Ss    6:11PM   0:01.10 /usr/pbi/haproxy-amd64/sbin/haproxy -f /var/etc/haproxy.cfg -p /var/run/haproxy.pid -st 22794
    

    When I try to restart the process from the webgui sometimes it works (I can see the PID changes), some times it doesn't.

    Some other times it just doesn't respond at all, and the only way of restarting the process is running

    killall haproxy
    rm /var/run/haproxy.pid
    /usr/pbi/haproxy-amd64/sbin/haproxy -f /var/etc/haproxy.cfg -p /var/run/haproxy.pid -D
    

    Any idea where can I debug this? I installed a copy on virtual box and I got the same behaviour as soon as I start fiddling.

    Tnx in advance



  • Hi nublaii,

    That haproxy doesnt 'respond' to service-stop service-start requests seems to be 'by design'.. This because the restarting of haproxy is not a combination of 'stop' and 'start', but haproxy does a pretty much seamless restart while transferring persistence information and finishing old connections through the old process.

    However when you apply a new good configuration the process should restart with a new PID.
    Could try and see if you use the haproxy-devel package you get that same behavior?

    I've done quite a bit of modifications to that -devel package, also in the startup / config-checking. It can be if you configured something 'wrong' that haproxy doesnt start a new process and keeps the old one running..

    If you've got the same problems there maybe i can help getting it diagnosed /fixed.

    Greets PiBa-NL


Log in to reply