Comment 12 for bug 1494141

Revision history for this message
Louis Bouchard (louis) wrote : Re: HAProxy 1.5 init script does not terminate processes

Good catch Claudio. The bug is present in Trusty and Trusty-backports.

Prior to LP: #1477198, the stop script did not stop at all because it relied on the --pid option that is introduced in dpkg version 1.17.6 as outlined in the man page of start-stop-daemon :

       [--pid] pid
              Check for a process with the specified pid (since version 1.17.6). The pid must be a number greater than 0.

Now with the fix introduced by LP: #1477198, it will work as expected unless nproc > 1. Otherwise, we will see the behavior described in LP: #1481737 whereas processes other than the first PID appearing in the pidfile will remain active.

The patch included here solves both situation as it loops through all the PIDs in the pidfile & terminates them using a temporary pidfile.

I will carry on this explanation in the other bug so the version in -updates is fixed as well.

This bug remains valid as we still see only the first PID being killed with the recent patch.