Every time I try to start haproxy I have to first manually create the /run/haproxy directory so that the socket file can be created. This directory gets destroyed on haproxy shutdown and not recreated by the init script. root@os:~ # /etc/init.d/haproxy start * Checking /etc/haproxy/haproxy.cfg ... [ ok ] * Starting haproxy ... [ALERT] 237/122115 (3994) : Starting frontend GLOBAL: cannot bind UNIX socket [/run/haproxy/admin.sock] * start-stop-daemon: failed to start `/usr/bin/haproxy' * Failed to start haproxy [ !! ] * ERROR: haproxy failed to start
Version: net-proxy/haproxy-1.6.11-r1
Either configure haproxy to create the socket directly under /run or create a /etc/tmpfiles.d/haproxy.conf file (I hear they are supported in OpenRC too) with: D /run/haproxy 0750 root haproxy
haproxy does not come with a default config and thus you'll have to create all files/directories that are required by your setup on your own. It is easily possible to hook the init scripts by extending the conf.d file or like zless mentioned perhaps. Does this work for you?
I already do this: test -d /run/haproxy || mkdir /run/haproxy /etc/init.d/haproxy start /run/haproxy disappears after every shutdown; this must be done for every startup. I'll look into the /etc/conf.d method. It's weak sauce though. The PID directory ought to be managed by the daemon. I suppose I need to take this up with upstream.