Missing running check on init script
Affects | Status | Importance | Assigned to | Milestone | |
---|---|---|---|---|---|
haproxy (Ubuntu) |
Fix Released
|
High
|
Unassigned | ||
Precise |
Won't Fix
|
High
|
Unassigned | ||
Trusty |
Won't Fix
|
High
|
Unassigned | ||
Utopic |
Fix Released
|
High
|
Unassigned |
Bug Description
[Impact]
'service haproxy stop' returns 4 if haproxy was already stopped.
[Test Case]
sudo service haproxy start
sudo killall -9 haproxy
sudo service haproxy stop
echo $?
~=> this should print 0, not 4
sudo service haproxy start
sudo service haproxy stop
~=> make sure this still correctly prints 0
[Regression Potential]
if done wrongly we could further break the haproxy service stop.
[Other Info]
Hi, this is the relevant version information:
# lsb_release -rd
Description: Ubuntu 12.04 LTS
Release: 12.04
dpkg -l haproxy|tail -1
ii haproxy 1.4.18-0ubuntu1 fast and reliable load balancing reverse proxy
When I issue a stop to haproxy via the init script, on line 49 it tries to kill the process and returns 4 in case of failure, which then after iis the exit status of the script itself.
There are many reasons why stopping a process may fail, one of them is that the process wasn't actually running. In that case, I think the exit status of stop should be 0, since the process is stopped.
This caused problems in the following scenario: haproxy governed by pacemaker if the haproxy process stops abruptly for some reason (crash, oom-killer), pacemaker will try to stop and start it again, but it will fail to stop (exit 4, expected 0).
To work around this, I added a check on the init script to see if the process was running, see patch attached.
Changed in haproxy (Ubuntu Trusty): | |
status: | New → Confirmed |
importance: | Undecided → High |
Changed in haproxy (Ubuntu Utopic): | |
importance: | Undecided → High |
description: | updated |
Changed in haproxy (Ubuntu Precise): | |
importance: | Undecided → High |
status: | New → Confirmed |
tags: | added: precise |
description: | updated |
tags: | removed: removal-candidate verification-needed |
The attachment "haproxy.diff" of this bug report has been identified as being a patch. The ubuntu-reviewers team has been subscribed to the bug report so that they can review the patch. In the event that this is in fact not a patch you can resolve this situation by removing the tag 'patch' from the bug report and editing the attachment so that it is not flagged as a patch. Additionally, if you are member of the ubuntu-reviewers team please also unsubscribe the team from this bug report.
[This is an automated message performed by a Launchpad user owned by Brian Murray. Please contact him regarding any issues with the action taken in this bug report.]