<div dir="ltr"><div class="gmail_extra"><div class="gmail_quote">On Mon, Nov 9, 2015 at 11:21 AM, James Page <span dir="ltr"><<a href="mailto:james.page@ubuntu.com" target="_blank">james.page@ubuntu.com</a>></span> wrote:<br><blockquote class="gmail_quote" style="margin:0px 0px 0px 0.8ex;border-left-width:1px;border-left-color:rgb(204,204,204);border-left-style:solid;padding-left:1ex"><div dir="ltr"><div class="gmail_extra"><div class="gmail_quote"><span class="">On Mon, Nov 9, 2015 at 11:06 AM, Vincent Bernat <span dir="ltr"><<a href="mailto:bernat@debian.org" target="_blank">bernat@debian.org</a>></span> wrote:<br><blockquote class="gmail_quote" style="margin:0px 0px 0px 0.8ex;border-left-width:1px;border-left-color:rgb(204,204,204);border-left-style:solid;padding-left:1ex">> Right - I see; I guess the benefit of using start-stop-daemon is that<br>
> it will only kill haproxy processes, whereas the kill loop is<br>
> indiscriminate.<br>
<br>
Yes. This is error-prone (and I just noticed that I have the same<br>
problem in my backport of 1.6 for Trusty) but I think that the best for<br>
now is to stay as is. We could create PID files for each PID, but this<br>
won't look clean.<br></blockquote><div><br></div></span><div>Agreed - I think your kill based approach is OK and avoids such complexity. </div></div></div></div></blockquote><div><br></div><div>How would you feel about using:</div><div><br></div><div> for pid in $(cat $PIDFILE); do</div><div> if start-stop-daemon --help | grep -q "\-\-pid "; then</div><div> start-stop-daemon --quiet --oknodo --stop \</div><div> --retry 5 --pid $pid --exec $HAPROXY || ret=$?</div><div> else</div><div> if kill -0 $pid 2> /dev/null; then</div><div> /bin/kill $pid || ret=4</div><div> fi</div><div> fi</div><div> done</div><div><br></div><div>This would preserve use of stop-start-daemon if the version installed supported --pid, and drop back to the kill approach if not.</div><div><br></div><div>Would ease backporting to older Debian/Ubuntu versions. </div></div><br></div></div>