0

Did need to configurate and start HAproxy from User without SUDO rights. in general it turned out to be done.

/data/haproxy/haproxy -f /etc/haproxy/haproxy.cfg

stdout:

[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 did start OK:

[test@ser-app-0001 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

After I did want to make service. Create ha.service file in /etc/systemd/system

[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

after:

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

in result Service did start and 1-2 second ago did down:

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.

How solve this problem?

  • 1
    Kill off all instances manually first and then try a start through systemctl – Raman Sailopal Jul 18 '18 at 13:06
  • Absent stoped|working services and processes using haproxy. – Nikolay Baranenko Jul 18 '18 at 13:34
  • Please share the haproxy.cfg – slm Jul 18 '18 at 19:16
  • What version of haproxy? Earlier versions came with a haproxy-systemd-wrapper, needed to make haproxy compliant with systemd. – wurtel Jul 20 '18 at 7:39

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Browse other questions tagged or ask your own question.