Hi Hans,

I've tested this as follows:

lxc exec ubuntu:xenial tester && lxc exec tester bash

apt update && apt dist-upgrade -y && apt install -y haproxy
service haproxy restart
chmod -x /usr/sbin/haproxy
service haproxy restart
Job for haproxy.service failed because the control process exited with error 
code. See "systemctl status haproxy.service" and "journalctl -xe" for details.
root@tester:~# /etc/init.d/haproxy status
root@tester:~# echo $?
0

The issue isn't the pidfile check, but rather the executable check on
line 21:

test -x $HAPROXY || exit 0

Commenting that line yields:

root@tester:~# /etc/init.d/haproxy status
● haproxy.service - HAProxy Load Balancer
   Loaded: loaded (/lib/systemd/system/haproxy.service; enabled; vendor preset: 
enabled)
   Active: failed (Result: start-limit-hit) since Wed 2019-01-09 12:56:15 UTC; 
4min 1s ago
     Docs: man:haproxy(1)
           file:/usr/share/doc/haproxy/configuration.txt.gz
  Process: 6478 ExecStartPre=/usr/sbin/haproxy -f ${CONFIG} -c -q (code=exited, 
status=203/EXEC)
 Main PID: 6404 (code=exited, status=0/SUCCESS)

Jan 09 12:56:15 tester systemd[1]: haproxy.service: Control process exited, 
code=exited status=203
Jan 09 12:56:15 tester systemd[1]: Failed to start HAProxy Load Balancer.
Jan 09 12:56:15 tester systemd[1]: haproxy.service: Unit entered failed state.
Jan 09 12:56:15 tester systemd[1]: haproxy.service: Failed with result 
'exit-code'.
Jan 09 12:56:15 tester systemd[1]: haproxy.service: Service hold-off time over, 
scheduling restart.
Jan 09 12:56:15 tester systemd[1]: Stopped HAProxy Load Balancer.
Jan 09 12:56:15 tester systemd[1]: haproxy.service: Start request repeated too 
quickly.
Jan 09 12:56:15 tester systemd[1]: Failed to start HAProxy Load Balancer.
Jan 09 12:56:15 tester systemd[1]: haproxy.service: Unit entered failed state.
Jan 09 12:56:15 tester systemd[1]: haproxy.service: Failed with result 
'start-limit-hit'.
root@tester:~# echo $?
3


So /etc/init.d/haproxy needs a nonzero return code on line 21.

Can you check if this is the case upstream as well?


** Changed in: haproxy (Ubuntu)
       Status: New => Confirmed

** Tags added: bitesize

-- 
You received this bug notification because you are a member of Ubuntu
Bugs, which is subscribed to Ubuntu.
https://bugs.launchpad.net/bugs/1810926

Title:
  initscript status check is too fragile

To manage notifications about this bug go to:
https://bugs.launchpad.net/ubuntu/+source/haproxy/+bug/1810926/+subscriptions

-- 
ubuntu-bugs mailing list
ubuntu-bugs@lists.ubuntu.com
https://lists.ubuntu.com/mailman/listinfo/ubuntu-bugs

Reply via email to