EXIT_STATUS is missing from "stopping" on respawn
Affects | Status | Importance | Assigned to | Milestone | |
---|---|---|---|---|---|
upstart |
New
|
Undecided
|
Unassigned |
Bug Description
I have Job A that exits with code 2 if it's in need of Task B to be run before A is restarted. I use the respawn stanza in A and "start on stopping A EXIT_STATUS=2" in B, along with the "task" stanza to make B complete before A respawns.
The issue is that having the respawn stanza in A causes EXIT_STATUS to not appear in the "stopping" environment for B.
You can reproduce this using these two simple jobs:
A.conf:
exec cat sadjkbdsaflkjb #returns exit code 1
respawn
respawn limit 2 30
B.conf:
start on stopping A
task
script
echo "exit status $EXIT_STATUS"
# should print exit status 1 to log
end script
If you remove the respawn from A, task B prints "exit status 1" as expected. With the respawn though, the EXIT_STATUS seems to be thrown away.
This is a major problem for me, because I need a task to be run before a respawn on a certain exit code, but can find no way of doing so.