Exit status not propagated with respawn flag
I have a simple upstart task that looks for stopping jobs and reports all of the environ info about them:
crash-reporter.
=======
description "Checks for job failure and reports crashes"
# Obviously, we don't need to have this checking itself constantly...
start on stopping JOB!=crash-reporter
task
console log
script
date
echo "Job has stopped"
env
echo
end script
=======
Now, I have a very simple test case job that shows my issue:
failure-job.conf:
=======
console log
# No respawn flag here!
script
sleep 10
false
end script
=======
When I run failure-job (start failure-job), it behaves as expected and I get this:
/var/log/
=======
Tue Aug 14 11:44:03 PDT 2012
Job has stopped
UPSTART_INSTANCE=
EXIT_STATUS=1
INSTANCE=
UPSTART_
TERM=linux
PATH=/usr/
PROCESS=main
UPSTART_
PWD=/
RESULT=failed
JOB=failure-job
=======
Looks good! failure-job failed and EXIT_STATUS is 1 as expected. However, if I add the respawn flag to failure-jobs conf, I get this instead:
/var/log/
=======
Tue Aug 14 11:43:41 PDT 2012
Job has stopped
UPSTART_INSTANCE=
INSTANCE=
UPSTART_
TERM=linux
PATH=/usr/
UPSTART_
PWD=/
RESULT=ok
JOB=failure-job
=======
Note that RESULT is 'ok' and there's no exit status reported (which seems normal for result = ok).
What I expect to happen: When a job is set to respawn, if the exit status is non-zero, this is reported in the 'stopping' event as it is when a job is set to not respawn.
Is this intended upstart behavior?
Question information
- Language:
- English Edit question
- Status:
- Expired
- For:
- upstart Edit question
- Assignee:
- No assignee Edit question
- Last query:
- Last reply: