N
N
Nikolay Baranenko2018-07-18 15:47:29
CentOS
Nikolay Baranenko, 2018-07-18 15:47:29

Why doesn't haproxy start as a service?

Hello.
it was necessary to configure and run haproxy as a user without sudo rights
, in general, it turned out to be done
/data/haproxy/haproxy -f /etc/haproxy/haproxy.cfg

[WARNING] 198/141606 (119143) : config : 'option forwardfor' ignored for frontend 'https-in' as it requires HTTP mode.
[WARNING] 198/141606 (119143) : config : 'option forwardfor' ignored for backend 'https-servers-basic' as it requires HTTP mode.
[WARNING] 198/141606 (119143) : config : 'option forwardfor' ignored for backend 'https-servers-redirect' as it requires HTTP mode.
[WARNING] 198/141606 (119143) : config : 'option forwardfor' ignored for backend 'https-servers-service' as it requires HTTP mode.

process started fine
[[email protected] haproxy]$ ps aux | grep haproxy
test   5109  0.3  0.0  49040  5224 ?        Ss   15:37   0:00 /data/haproxy/haproxy -f /etc/haproxy/haproxy.cfg

next I wanted to make a service
created in /etc/systemd/system
ha.service
[Unit]
Description=ha.service
[Service]
Type=simple
User=test
WorkingDirectory=/data/haproxy/
ExecStart=/data/haproxy/haproxy -f /etc/haproxy/haproxy.cfg
SyslogIdentifier=ha.service-log
Restart=always
[Install]
WantedBy=multi-user.target

Further
systemctl daemon-reload && systemctl start ha.service && systemctl status ha.service

As a result, the service starts and after a second it crashes.
Jul 18 15:41:26 ser-app-0001 systemd[1]: ha.service holdoff time over, scheduling restart.
Jul 18 15:41:26 ser-app-0001 systemd[1]: Started ha.service.
Jul 18 15:41:26 ser-app-0001 systemd[1]: Starting ha.service...
Jul 18 15:41:26 ser-app-0001 ha.service-log[5871]: [WARNING] 198/154126 (5871) : config : 'option forwardfor' ignored for frontend 'https-in' as it requires HTTP mode.
Jul 18 15:41:26 ser-app-0001 ha.service-log[5871]: [WARNING] 198/154126 (5871) : config : 'option forwardfor' ignored for backend 'https-servers-basic' as it requires HTTP mode.
Jul 18 15:41:26 ser-app-0001 ha.service-log[5871]: [WARNING] 198/154126 (5871) : config : 'option forwardfor' ignored for backend 'https-servers-redirect' as it requires HTTP mode.
Jul 18 15:41:26 ser-app-0001 ha.service-log[5871]: [WARNING] 198/154126 (5871) : config : 'option forwardfor' ignored for backend 'https-servers-service' as it requires HTTP mode.
Jul 18 15:41:26 ser-app-0001 systemd[1]: ha.service holdoff time over, scheduling restart.
Jul 18 15:41:26 ser-app-0001 systemd[1]: start request repeated too quickly for ha.service
Jul 18 15:41:26 ser-app-0001 systemd[1]: Failed to start ha.service.
Jul 18 15:41:26 ser-app-0001 systemd[1]: Unit ha.service entered failed state.
Jul 18 15:41:26 ser-app-0001 systemd[1]: ha.service failed.

What could be the reason and how to solve it?

Answer the question

In order to leave comments, you need to log in

Didn't find what you were looking for?

Ask your question

Ask a Question

731 491 924 answers to any question