Init script fails to stop service
Affects | Status | Importance | Assigned to | Milestone | |
---|---|---|---|---|---|
haproxy (Ubuntu) |
Confirmed
|
Undecided
|
Unassigned |
Bug Description
Init script fails to stop service
[Environment]
Trusty 14.04.2
[Description]
This seems to have been introduced in 1.4.24-2ubuntu0.1 as part of https:/
The problem as far as I can see it is that Trustys start-stop-daemon version doesn't handle --pid as expected by the init script. It only knows --pidfile.
for pid in $(cat $PIDFILE); do
done
start-stop-daemon treats the argument to --pid as a PID file and therefore tries to open it, which fails.
Debugging output:
root@ubuntu-1404:~# ps -ef | grep haproxy | grep -v grep
haproxy 31802 1 0 16:25 ? 00:00:00 /usr/sbin/haproxy -f /etc/haproxy/
root@ubuntu-1404:~# /etc/init.d/haproxy status
haproxy is running.
root@ubuntu-1404:~# cat /var/run/
31802
root@ubuntu-1404:~# bash -x /etc/init.d/haproxy stop
...
++ cat /var/run/
+ for pid in '$(cat $PIDFILE)'
+ start-stop-daemon --quiet --oknodo --stop --retry 5 --pid 31802 --exec /usr/sbin/haproxy
+ '[' 0 -eq 0 ']'
+ rm -f /var/run/
...
+ return 0
+ exit 0
root@ubuntu-1404:~# strace -f start-stop-daemon --quiet --oknodo --stop --retry 5 --pid 31802 --exec /usr/sbin/haproxy
....
open("31802", O_RDONLY) = -1 ENOENT (No such file or directory)
exit_group(0) = ?
+++ exited with 0 +++
root@ubuntu-1404:~#
root@ubuntu-1404:~# ps -ef | grep haproxy | grep -v grep
haproxy 31802 1 0 16:25 ? 00:00:00 /usr/sbin/haproxy -f /etc/haproxy/
root@ubuntu-1404:~# cat /var/run/
cat: /var/run/
root@ubuntu-1404:~#
root@ubuntu-1404:~# dpkg -l haproxy dpkg
Desired=
| Status=
|/ Err?=(none)
||/ Name Version Architecture Description
+++-===
ii dpkg 1.17.5ubuntu5.4 amd64 Debian package management system
ii haproxy 1.4.24-2ubuntu0.1 amd64 fast and reliable load balancing reverse proxy
root@ubuntu-1404:~#
This is affecting us too. Moving from 1.4.24-2 to 1.4.24-2ubuntu0.1 broke our chef deploys. We restart haproxy at the end of our recipe and the old process doesn't get killed.