[Pkg-haproxy-maintainers] Bug#804530: Bug#804530: Bug#804530: haproxy: Ensure stop action works on pre-systemd versions of Debian (and Ubuntu)

James Page james.page at ubuntu.com
Mon Nov 9 11:51:47 UTC 2015

On Mon, Nov 9, 2015 at 11:21 AM, James Page <james.page at ubuntu.com> wrote:

> On Mon, Nov 9, 2015 at 11:06 AM, Vincent Bernat <bernat at debian.org> wrote:
>> > Right - I see; I guess the benefit of using start-stop-daemon is that
>> > it will only kill haproxy processes, whereas the kill loop is
>> > indiscriminate.
>> Yes. This is error-prone (and I just noticed that I have the same
>> problem in my backport of 1.6 for Trusty) but I think that the best for
>> now is to stay as is. We could create PID files for each PID, but this
>> won't look clean.
> Agreed - I think your kill based approach is OK and avoids such
> complexity.

How would you feel about using:

    for pid in $(cat $PIDFILE); do
        if start-stop-daemon --help | grep -q "\-\-pid "; then
            start-stop-daemon --quiet --oknodo --stop \
                --retry 5 --pid $pid --exec $HAPROXY || ret=$?
            if kill -0 $pid 2> /dev/null; then
                /bin/kill $pid || ret=4

This would preserve use of stop-start-daemon if the version installed
supported --pid, and drop back to the kill approach if not.

Would ease backporting to older Debian/Ubuntu versions.
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.alioth.debian.org/pipermail/pkg-haproxy-maintainers/attachments/20151109/e290c4ac/attachment.html>

More information about the Pkg-haproxy-maintainers mailing list