Gentoo Websites Logo
Go to: Gentoo Home Documentation Forums Lists Bugs Planet Store Wiki Get Gentoo!
Bug 628986 - net-proxy/haproxy fails to start: cannot bind UNIX socket
Summary: net-proxy/haproxy fails to start: cannot bind UNIX socket
Status: RESOLVED INVALID
Alias: None
Product: Gentoo Linux
Classification: Unclassified
Component: Current packages (show other bugs)
Hardware: All Linux
: Normal normal (vote)
Assignee: Christian Ruppert (idl0r)
URL:
Whiteboard:
Keywords:
Depends on:
Blocks:
 
Reported: 2017-08-26 18:45 UTC by Carlos Konstanski
Modified: 2018-07-16 14:48 UTC (History)
1 user (show)

See Also:
Package list:
Runtime testing required: ---


Attachments

Note You need to log in before you can comment on or make changes to this bug.
Description Carlos Konstanski 2017-08-26 18:45:26 UTC
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
Comment 1 Carlos Konstanski 2017-08-26 18:46:11 UTC
Version: net-proxy/haproxy-1.6.11-r1
Comment 2 zless 2018-04-27 07:59:50 UTC
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
Comment 3 Christian Ruppert (idl0r) gentoo-dev 2018-07-16 11:32:25 UTC
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?
Comment 4 Carlos Konstanski 2018-07-16 14:48:01 UTC
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.