4

I've configured my HAProxy server to run in a chroot jail logging messages to syslog socket. My problem is that the only messsages currently being logged are for when haproxy is starting up.

May 26 10:42:37 dev haproxy[13986]: Proxy my_listener started.

I've created a user and group called haproxy and then done the following:

su -l haproxy
mkdir jail
mkdir -m 2750 jail/dev
chmod a-w jail

Relevant lines from my haproxy configuration are:

global
    chroot          /home/haproxy/jail
    daemon
    group           haproxy
    node            haproxy
    log             /home/haproxy/jail/dev/log local0

defaults
    log             global
    option          tcplog

syslogd is being started with the option -a /home/haproxy/jail/dev/log and I've added the following line to /etc/syslog.conf

local0.*            -/var/log/haproxy.log

ls -la on jail/dev gives

drwxrws--- 2 haproxy haproxy 4096 May 26 11:07 .
dr-xr-x--x 3 haproxy haproxy 4096 May 26 11:01 ..
srw-rw-rw- 1 root    haproxy    0 May 26 11:07 log

Running Centos 5.5 and HAProxy 1.4.21. As I said I only see the listener start-up messages in haproxy.log and nothing else.

1 Answer 1

2

The problem here was that the path to the syslog socket needed to be specified from the chroot jail directory. The following fixes the issue for me

global
    log             /home/haproxy/jail/dev/log local0

defaults
    log             /dev/log local0

One slight issue is that the started messages appear before the stopping messages if you do a reload but I can live with that.

1
  • 1
    I would've thought that was a good thing, you want the new process to start handling new connections, then shut the old one down! I assume 'restart' works differently in your init(?) script.
    – Pricey
    Sep 27, 2012 at 11:54

You must log in to answer this question.

Not the answer you're looking for? Browse other questions tagged .