Score:0

socat is missing commands for haproxy on ubuntu 20.04

vn flag

I have installed haproxy 2.6.6, socat 1.7.4.1 and have a working load balancer for Exchange. I want to be able to turn off a node for maintenance and have unsuccessfully tried to use socat to do this.

In my haproxy.cfg global section I have:

stats socket /run/haproxy-master.sock mode 660 level admin expose-fd listeners
stats timeout 30s
user haproxy
group haproxy
daemon

When I am using this command

echo "disable server exch01" | sudo socat stdio unix-connect:/run/haproxy-master.sock

I get

unknown command, but maybe one of the following ones is a better match:
show cli level,
show cli sockets,
show proc,
show version,
help,
prompt,
quit

By sending show cli level it returns admin

If I sudo to root I get a few more commands, like

@master,
@!,
@,
operator,
reload,
user,
prompt

But I am missing disable server etc

So it looks like it is a permission thing, and since I am root it may be something with the initiation of the stats sockets in haproxy?

I have tried everything

vidarlo avatar
ar flag
What shell are you using? `quit` and `show cli level` reminds me more of networking devices than bash shell.
02dag avatar
vn flag
I am using the default in ubuntu, bash
vidarlo avatar
ar flag
Ah, it's not socat that is missing - it's haproxy.
02dag avatar
vn flag
Can you expand a bit on that?
02dag avatar
vn flag
Permissions on the socket-file itself? ls-l gives srwxr-xr-x 1 root root 0 date haproxy-master.sock
Score:0
vn flag

I didnt install haproxy by using sudo update install haproxy from Ubuntu itself, Instead I downloaded the latest version of haproxy, which of that time was 2.6.6 and installed it manually. This was a bad decision

That version doesnt install /run/haproxy/admin.sock which socat needs.

I started over and installed from Ubuntu and everything worked as it should.

Could be some libraries missing in the downloadable version or some prereq tasks I have missed.

I sit in a Tesla and translated this thread with Ai:

mangohost

Post an answer

Most people don’t grasp that asking a lot of questions unlocks learning and improves interpersonal bonding. In Alison’s studies, for example, though people could accurately recall how many questions had been asked in their conversations, they didn’t intuit the link between questions and liking. Across four studies, in which participants were engaged in conversations themselves or read transcripts of others’ conversations, people tended not to realize that question asking would influence—or had influenced—the level of amity between the conversationalists.