Skip to content

haproxy.conf.erb stats directive makes haproxy service unavailable (service down) #313

@NVitanovic

Description

@NVitanovic

When service is started/restarted this message appears on status.

root@lb1:~# service haproxy status
● haproxy.service - HAProxy Load Balancer
   Loaded: loaded (/lib/systemd/system/haproxy.service; enabled; vendor preset: enabled)
   Active: inactive (dead) since Tue 2017-12-26 06:24:08 EST; 16s ago
     Docs: man:haproxy(1)
           file:/usr/share/doc/haproxy/configuration.txt.gz
  Process: 6055 ExecStart=/usr/sbin/haproxy-systemd-wrapper -f ${CONFIG} -p /run/haproxy.pid $EXTRAOPTS (code=exited, status=0/SUCCESS)
  Process: 6051 ExecStartPre=/usr/sbin/haproxy -f ${CONFIG} -c -q (code=exited, status=0/SUCCESS)
 Main PID: 6055 (code=exited, status=0/SUCCESS)

Dec 26 06:24:08 lb1 systemd[1]: haproxy.service: Service hold-off time over, scheduling restart.
Dec 26 06:24:08 lb1 systemd[1]: Stopped HAProxy Load Balancer.
Dec 26 06:24:08 lb1 systemd[1]: haproxy.service: Start request repeated too quickly.
Dec 26 06:24:08 lb1 systemd[1]: Failed to start HAProxy Load Balancer.

More detailed error when haproxy is run in debug mode:

root@lb1:~# haproxy -f /etc/haproxy/haproxy.cfg -d
[WARNING] 359/063924 (6754) : parsing [/etc/haproxy/haproxy.cfg:91] : 'balance' ignored because frontend 'ftpcluster' has no backend capability.
[WARNING] 359/063924 (6754) : parsing [/etc/haproxy/haproxy.cfg:93] : 'stick' ignored because frontend 'ftpcluster' has no backend capability.
Available polling systems :
      epoll : pref=300,  test result OK
       poll : pref=200,  test result OK
     select : pref=150,  test result FAILED
Total: 3 (2 usable), will use epoll.
Using epoll() as the polling mechanism.
[ALERT] 359/063924 (6754) : Starting frontend GLOBAL: error when trying to preserve previous UNIX socket [/var/run/haproxy]

Solution is to remove/comment the following lines in haproxy.conf.erb:

stats socket /run/haproxy/admin.sock mode 660 level admin
stats timeout 30s
stats socket /var/run/haproxy

After that service starts without problems.

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions