HAProxy community

Remote control with socket/socat


I’ve created this acl:

acl in_maintenance always_false -u 1

And use it like this (yes, I know there are other ways to do it, there’s a reason for this):

use_backend sorry if in_maintenance

But can’t figure out how to change the acl to the value “always_true” using socat. I can see the acl when I run “show acl”:

1 () acl ‘always_false’ file ‘/etc/haproxy/haproxy.cfg’ line 74

But any attempt to use “add acl” or “del acl” throws an error or says Done, but doesn’t change the backend. For example:

echo “add acl #1 always_true” | socat tcp-connect: stdio

Hitting the url doen’t take you to the “sorry” backend.

Likewise, attempting to delete:

echo “del acl #1 always_false” | socat tcp-connect: stdio
Key not found.

Obviously, I don’t understand how to use this.

To put it simply, how do I change the acl from “always_false” to “always_true” and back?