Ah good catch, the exit 0 was higher up.
Additionally, I had misread the haproxy_status function, the pid is actually 
looked up in the process table at line 99 (even if the comment is wrong and 3 
should be returned, not 1).

Though here's another reproducer:
root@juju-8d5e58-14:~# systemctl mask haproxy.service
root@juju-8d5e58-14:~# service haproxy status &>/dev/null; echo $?
3
root@juju-8d5e58-14:~# /etc/init.d/haproxy status; echo $?
0

That exit 0 comes from line 14 of /lib/lsb/init-functions.d/40-systemd
though.

-- 
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