On Tue, May 10, 2016 at 04:01:24PM +0200, Mehdi Ahmadi wrote:
> In the case of `stop` - I image that the stale / former sockets can be
> listed using:
> `sudo lsof | grep SOMETHING` ?

No since there's no more process. What you see is just a file system
entry. If you try to connect to it using socat, you'll see "connection
refused" which indicates there's nobody there anymore.

> I'm wondering if an additional shell level checks / cleanup can be done in
> such cases were related PID's would be killed? - or perhaps there's a core
> part to how socets are created and managed that I'm lacking.

It could, but it's dangerous as the script would have to guess the paths
correctly from parsing the haproxy config... Or you could put all of them
into a dedicated subdir and remove them on stop. But even then it will not
scale well with multiple instances.

I'd really suggest to place them somewhere it cannot bother you and ignore
them. /var/run is quite common for this, example :

  $ find /var/ -type s 2>/dev/null 
  /var/run/acpid.socket
  /var/run/rpcbind.sock
  /var/run/dbus/system_bus_socket

Willy


Reply via email to