haproxy stop action does not work

Bug #1513923 reported by Andreas Hasenack
12
This bug affects 2 people
Affects Status Importance Assigned to Milestone
Ubuntu Cloud Archive
New
Undecided
Unassigned

Bug Description

Observation:

On Trusty the start-stop-daemon (man start-stop-daemon) just supports the --pidfile parameter, since utopic, that parameter was split on --pidfile --ppid and --pid parameters.

On dev release the stop function actually makes use of the --pid parameter , which is unexistant on the trusty version of start-stop-daemon, for this reason any backport made from dev to trusty will consequently not work.

Note that this bug also affects Kilo backports.

Please also note that this is actually fixed on trusty-updates via
the bug http://pad.lv/1477198.

With liberty:

*** 1.5.14-1~cloud2 0
        500 http://ubuntu-cloud.archive.canonical.com/ubuntu/ trusty-updates/liberty/main amd64 Packages

"service haproxy stop" does not work:

The stop action in /etc/init.d/haproxy does this:
                start-stop-daemon --quiet --oknodo --stop \
                        --retry 5 --pid $pid --exec $HAPROXY || ret=$?

--pid is not a valid option for trusty's start-stop-daemon.

In trusty proper, that stop action does:
       start-stop-daemon --quiet --oknodo --stop \
                --retry 5 --pidfile $PIDFILE --exec $HAPROXY || ret=$?

Example:
No haproxy running yet:
root@juju-machine-1-lxc-2:~# ps fxaw|grep haproxy
 104776 pts/2 S+ 0:00 | \_ grep --color=auto haproxy

let's start one:
root@juju-machine-1-lxc-2:~# service haproxy start
 * Starting haproxy haproxy
   ...done.

Ok, it's there:
root@juju-machine-1-lxc-2:~# ps fxaw|grep haproxy|grep -v grep
 104786 ? Ss 0:00 /usr/sbin/haproxy -f /etc/haproxy/haproxy.cfg -D -p /var/run/haproxy.pid

Let's restart:
root@juju-machine-1-lxc-2:~# service haproxy restart
 * Restarting haproxy haproxy
   ...done.

And now I have two!
root@juju-machine-1-lxc-2:~# ps fxaw|grep haproxy|grep -v grep
 104786 ? Ss 0:00 /usr/sbin/haproxy -f /etc/haproxy/haproxy.cfg -D -p /var/run/haproxy.pid
 104803 ? Ss 0:00 /usr/sbin/haproxy -f /etc/haproxy/haproxy.cfg -D -p /var/run/haproxy.pid
root@juju-machine-1-lxc-2:~#

Let's try to kill one just like the initscript does it, with the --pid option that does not exist in trusty:
root@juju-machine-1-lxc-2:~# start-stop-daemon --oknodo --stop --retry 5 --pid 104803 --exec /usr/sbin/haproxy
No /usr/sbin/haproxy found running; none killed.

Still alive:
root@juju-machine-1-lxc-2:~# ps fxaw|grep haproxy|grep -v grep
 104786 ? Ss 0:00 /usr/sbin/haproxy -f /etc/haproxy/haproxy.cfg -D -p /var/run/haproxy.pid
 104803 ? Ss 0:00 /usr/sbin/haproxy -f /etc/haproxy/haproxy.cfg -D -p /var/run/haproxy.pid
root@juju-machine-1-lxc-2:~#

Tags: sts
description: updated
description: updated
description: updated
description: updated
description: updated
tags: added: sts
description: updated
description: updated
Scott Moser (smoser)
description: updated
description: updated
Revision history for this message
Louis Bouchard (louis) wrote :

A fix for that has been uploaded and is waiting in the SRU queue. please see the original bug for details

To post a comment you must log in.
This report contains Public information  
Everyone can see this information.

Other bug subscribers

Remote bug watches

Bug watches keep track of this bug in other bug trackers.