Activity log for bug #1481737

Date Who What changed Old value New value Message
2015-08-05 12:10:25 Peter G. Marczis bug added bug
2015-08-06 22:57:36 Robie Basak bug added subscriber Ubuntu Server Team
2015-09-05 20:29:20 Launchpad Janitor haproxy (Ubuntu): status New Confirmed
2015-09-07 10:10:49 Robie Basak tags haproxy haproxy needs-upstream-report
2015-09-07 10:11:07 Robie Basak summary HAProxy init script is not working properly HAProxy init script does not work correctly with nbproc configuration option
2015-09-23 15:47:11 Louis Bouchard nominated for series Ubuntu Trusty
2015-09-23 15:47:11 Louis Bouchard bug task added haproxy (Ubuntu Trusty)
2015-09-23 15:47:21 Louis Bouchard haproxy (Ubuntu Trusty): importance Undecided Medium
2015-09-23 15:47:25 Louis Bouchard haproxy (Ubuntu Trusty): status New In Progress
2015-09-23 15:47:27 Louis Bouchard haproxy (Ubuntu Trusty): assignee Louis Bouchard (louis-bouchard)
2015-09-23 15:47:41 Louis Bouchard haproxy (Ubuntu): status Confirmed Invalid
2015-09-24 09:24:07 Louis Bouchard description In case you have more than one process enabled in the haproxy config, the init script fails to stop all of those processes. So to clarify you need to have this in your haproxy.cfg: """ ... global maxconn 32000 ulimit-n 65536 user haproxy group haproxy nbproc 2 ... """ the problem is more visible if you set the nbproc to higher number. service haproxy stop --> will only stop on of the haproxy processes. The problem is so that start-stop-daemon can't handle pid files with multiple lines. Only stopping the first one. HAProxy does write all the pids started by itself into the pid file, so the problem is not in HAProxy, but in the start-stop-daemon or more likely in the init scrip of haproxy. One solution or workaround is to remove pidfile option of start-stop-daemon in the init script, than it wil work as killall and will stop the haproxy processes properly. To proof you can try this sequence: service haproxy start #if its not running ps ax | grep haproxy | grep -v grep | wc -l #this should report 2 service haproxy restart ps ax | grep haproxy | grep -v grep | wc -l #this will report 3 The workaround as a diff: root@ubi1:/opt# diff /etc/init.d/haproxy /etc/init.d/haproxy.orig 62c62 < --retry 5 --exec $HAPROXY || ret=$? --- > --retry 5 --pidfile $PIDFILE --exec $HAPROXY || ret=$? extra infos: root@ubi1:/opt# lsb_release -rd Description: Ubuntu 14.04.3 LTS Release: 14.04 root@ubi1:/opt# apt-cache policy haproxy haproxy: Installed: 1.4.24-2ubuntu0.2 Candidate: 1.4.24-2ubuntu0.2 Version table: 1.5.3-1~ubuntu14.04.1 0 100 http://us.archive.ubuntu.com/ubuntu/ trusty-backports/main amd64 Packages *** 1.4.24-2ubuntu0.2 0 500 http://us.archive.ubuntu.com/ubuntu/ trusty-updates/main amd64 Packages 100 /var/lib/dpkg/status 1.4.24-2 0 500 http://us.archive.ubuntu.com/ubuntu/ trusty/main amd64 Packages [SRU justification] The sysVinit script does not completely stop processes when nbproc > 1 [Impact] Stopping haproxy without this fix leaves all but one process running [Fix] Use temporary pidfile in a loop containing one single PID as the --pid option is not available for start-stop-daemon. [Test Case] Set nbproc > 4 in /etc/haproxy/haproxy.cfg resart haproxy & verify that there is more than one haproxy process Run : $ ps aux | grep haproxy | grep -v grep | wc -l 4 $ service haproxy stop $ ps aux | grep haproxy | grep -v grep | wc -l Without the patch, the result of the last command will be 3. With the fix, it will be 0 [Regression] The regression risk is in the use of a temporary file instead of the start-stop-daemon option. It has been tested with TMPDIR="/tmp/My Dir" to check for spaces in directory names. [Original description of the problem] In case you have more than one process enabled in the haproxy config, the init script fails to stop all of those processes. So to clarify you need to have this in your haproxy.cfg: """ ... global         maxconn 32000         ulimit-n 65536         user haproxy         group haproxy         nbproc 2 ... """ the problem is more visible if you set the nbproc to higher number. service haproxy stop --> will only stop on of the haproxy processes. The problem is so that start-stop-daemon can't handle pid files with multiple lines. Only stopping the first one. HAProxy does write all the pids started by itself into the pid file, so the problem is not in HAProxy, but in the start-stop-daemon or more likely in the init scrip of haproxy. One solution or workaround is to remove pidfile option of start-stop-daemon in the init script, than it wil work as killall and will stop the haproxy processes properly. To proof you can try this sequence: service haproxy start #if its not running ps ax | grep haproxy | grep -v grep | wc -l #this should report 2 service haproxy restart ps ax | grep haproxy | grep -v grep | wc -l #this will report 3 The workaround as a diff: root@ubi1:/opt# diff /etc/init.d/haproxy /etc/init.d/haproxy.orig 62c62 < --retry 5 --exec $HAPROXY || ret=$? --- > --retry 5 --pidfile $PIDFILE --exec $HAPROXY || ret=$? extra infos: root@ubi1:/opt# lsb_release -rd Description: Ubuntu 14.04.3 LTS Release: 14.04 root@ubi1:/opt# apt-cache policy haproxy haproxy:   Installed: 1.4.24-2ubuntu0.2   Candidate: 1.4.24-2ubuntu0.2   Version table:      1.5.3-1~ubuntu14.04.1 0         100 http://us.archive.ubuntu.com/ubuntu/ trusty-backports/main amd64 Packages  *** 1.4.24-2ubuntu0.2 0         500 http://us.archive.ubuntu.com/ubuntu/ trusty-updates/main amd64 Packages         100 /var/lib/dpkg/status      1.4.24-2 0         500 http://us.archive.ubuntu.com/ubuntu/ trusty/main amd64 Packages
2015-09-24 09:24:37 Louis Bouchard attachment added lp1494141_fix_stop_failure.debdiff https://bugs.launchpad.net/ubuntu/+source/haproxy/+bug/1481737/+attachment/4473139/+files/lp1494141_fix_stop_failure.debdiff
2015-09-24 09:25:00 Louis Bouchard bug added subscriber Ubuntu Stable Release Updates Team
2015-09-24 10:06:43 Louis Bouchard bug added subscriber Ubuntu Sponsors Team
2015-10-12 16:33:15 Louis Bouchard attachment removed lp1494141_fix_stop_failure.debdiff https://bugs.launchpad.net/ubuntu/+source/haproxy/+bug/1481737/+attachment/4473139/+files/lp1494141_fix_stop_failure.debdiff
2015-10-12 16:38:01 Louis Bouchard attachment added lp1481737_stop_multipid.debdiff https://bugs.launchpad.net/ubuntu/+source/haproxy/+bug/1481737/+attachment/4492590/+files/lp1481737_stop_multipid.debdiff
2015-10-22 14:52:35 Maykel Moya bug added subscriber Maykel Moya
2015-11-04 22:38:34 Mathieu Trudel-Lapierre removed subscriber Ubuntu Sponsors Team
2015-11-04 23:09:30 Mathew Hodson tags haproxy needs-upstream-report needs-upstream-report trusty
2015-11-04 23:14:03 Mathew Hodson haproxy (Ubuntu): status Invalid Fix Released
2015-11-04 23:14:04 Mathew Hodson haproxy (Ubuntu): importance Undecided Medium
2015-11-04 23:16:59 Mathew Hodson tags needs-upstream-report trusty trusty
2015-11-06 19:54:14 Louis Bouchard nominated for series Ubuntu Vivid
2015-11-06 19:54:14 Louis Bouchard bug task added haproxy (Ubuntu Vivid)
2015-11-06 19:54:20 Louis Bouchard haproxy (Ubuntu Vivid): assignee Louis Bouchard (louis-bouchard)
2015-11-06 19:54:30 Louis Bouchard haproxy (Ubuntu Vivid): importance Undecided Medium
2015-11-06 19:54:34 Louis Bouchard haproxy (Ubuntu Vivid): status New In Progress
2015-11-09 14:21:18 James Page nominated for series Ubuntu Wily
2015-11-09 14:21:18 James Page bug task added haproxy (Ubuntu Wily)
2015-11-09 14:21:18 James Page nominated for series Ubuntu Xenial
2015-11-09 14:21:18 James Page bug task added haproxy (Ubuntu Xenial)
2015-11-09 14:56:47 James Page haproxy (Ubuntu Xenial): status Fix Released In Progress
2015-11-09 14:56:52 James Page haproxy (Ubuntu Wily): importance Undecided Medium
2015-11-09 15:11:37 Launchpad Janitor haproxy (Ubuntu Xenial): status In Progress Fix Released
2015-11-09 16:55:46 James Page haproxy (Ubuntu Wily): status New In Progress
2015-11-09 16:55:52 James Page haproxy (Ubuntu Xenial): assignee James Page (james-page)
2015-11-09 16:55:54 James Page haproxy (Ubuntu Wily): assignee James Page (james-page)
2015-11-09 17:39:57 Chris J Arges haproxy (Ubuntu Wily): status In Progress Fix Committed
2015-11-09 17:40:00 Chris J Arges bug added subscriber SRU Verification
2015-11-09 17:40:04 Chris J Arges tags trusty trusty verification-needed
2015-11-11 09:07:19 James Page tags trusty verification-needed trusty verification-done
2015-11-18 15:20:53 Launchpad Janitor haproxy (Ubuntu Wily): status Fix Committed Fix Released
2015-11-18 15:21:02 Chris J Arges removed subscriber Ubuntu Stable Release Updates Team
2015-12-02 20:06:29 Chris J Arges haproxy (Ubuntu Trusty): status In Progress Fix Committed
2015-12-02 20:06:33 Chris J Arges bug added subscriber Ubuntu Stable Release Updates Team
2015-12-02 20:06:38 Chris J Arges tags trusty verification-done trusty
2015-12-02 20:06:39 Chris J Arges tags trusty trusty verification-needed
2015-12-08 16:13:23 Louis Bouchard tags trusty verification-needed trusty verification-done
2015-12-08 16:13:34 Louis Bouchard haproxy (Ubuntu Trusty): assignee Louis Bouchard (louis-bouchard)
2015-12-08 16:38:42 Louis Bouchard attachment added lp1481737_vivid.debdiff https://bugs.launchpad.net/ubuntu/+source/haproxy/+bug/1481737/+attachment/4531521/+files/lp1481737_vivid.debdiff
2015-12-09 14:43:55 Launchpad Janitor haproxy (Ubuntu Trusty): status Fix Committed Fix Released
2015-12-10 21:58:05 Brian Murray haproxy (Ubuntu Vivid): status In Progress Fix Committed
2015-12-10 21:58:14 Brian Murray tags trusty verification-done trusty
2015-12-10 21:58:15 Brian Murray tags trusty trusty verification-needed
2016-03-11 20:30:42 Ubuntu Foundations Team Bug Bot tags trusty verification-needed removal-candidate trusty verification-needed
2016-05-12 13:23:44 Martin Pitt haproxy (Ubuntu Vivid): status Fix Committed Won't Fix
2016-05-12 13:23:50 Martin Pitt removed subscriber Ubuntu Stable Release Updates Team
2016-05-12 13:23:51 Martin Pitt removed subscriber SRU Verification
2016-05-12 13:23:52 Martin Pitt tags removal-candidate trusty verification-needed removal-candidate trusty