Return code incorrect when garbd is already running
Bug #1308103 reported by
jmrenouard
This bug affects 1 person
Affects | Status | Importance | Assigned to | Milestone | ||
---|---|---|---|---|---|---|
Galera |
Fix Released
|
Undecided
|
Yan Zhang | |||
Percona XtraDB Cluster moved to https://jira.percona.com/projects/PXC | Status tracked in 5.6 | |||||
5.5 |
Fix Released
|
Low
|
Unassigned | |||
5.6 |
Fix Released
|
Low
|
Unassigned |
Bug Description
Context:
SysV init.d script: /etc/init.d/garb
Garbd is already running and started correctly.
Observed result:
service garb start
echo $?
0
Awaited result:
When garbd is already started, return code shouldn't return 0.
0 means success
If garbd is already running so trying to start garbd is expected to fail and return an non-zero return code.
Solution: return 3 instead of 0
--- garbd_origin 2014-04-15 16:48:20.115360380 +0200
+++ garb 2014-04-15 16:49:24.866360234 +0200
@@ -97,7 +97,7 @@
if [ -r $PIDFILE ]; then
- return 0
+ return 3
fi
[ -x $prog ] || return 5
Changed in galera: | |
status: | New → Confirmed |
assignee: | nobody → Yan Zhang (yan.zhang) |
Changed in galera: | |
milestone: | none → 25.3.6 |
status: | Confirmed → Fix Committed |
Changed in galera: | |
status: | Fix Committed → Fix Released |
To post a comment you must log in.
I have found a similar bug around stop function in this file: garb
function stop return 0 if garbd is not started. stop function did not successed stopping an non running program so non zero return code is better.
Best regards,