Initscript is not returning its exec code properly
Bug #1452878 reported by
Caio Begotti
This bug affects 1 person
Affects | Status | Importance | Assigned to | Milestone | |
---|---|---|---|---|---|
Capomastro |
Fix Released
|
High
|
Unassigned |
Bug Description
Manual check:
ubuntu@
-> celery@
- empty -
ubuntu@
0
Using the initscript:
ubuntu@
-> celery@
- empty -
ubuntu@
1
That's wrong and will probably count as one more hole in the initscript that will force us to use Celeryd's scripts instead, I guess.
Related branches
lp:~roadmr/capomastro/init-papercuts
- Caio Begotti (community): Approve
-
Diff: 36 lines (+8/-7)1 file modifieddebian/capomastro.init (+8/-7)
Changed in capomastro: | |
status: | Triaged → In Progress |
assignee: | nobody → Daniel Manrique (roadmr) |
Changed in capomastro: | |
status: | In Progress → Fix Committed |
Changed in capomastro: | |
status: | Fix Committed → Fix Released |
assignee: | Daniel Manrique (roadmr) → nobody |
To post a comment you must log in.
Oh, I see where the problem is.
do_check () {
${DAEMON} -A ${NAME} ${*}
[ "${?}" = 2 ] && return 2
return "${?}"
}
The [ "${?}" = 2 ] comparison is reassigning the value of $?, so when you check it on the next line, you get 1 (false), which is the result of the comparison, not of the daemon run check.
The function should look like this instead, so it immediately stores the value of celery inspect active to protect it from future alterations:
do_check () {
${DAEMON} -A ${NAME} ${*}
retval=${?}
[ "${retval}" = 2 ] && return 2
return "${retval}"
}