Assertion causing kernel panic with respawn stanza and post-start/pre-stop
Affects | Status | Importance | Assigned to | Milestone | |
---|---|---|---|---|---|
upstart |
Fix Released
|
High
|
Scott James Remnant (Canonical) | ||
0.3 |
Fix Released
|
High
|
Scott James Remnant (Canonical) | ||
0.5 |
Fix Released
|
High
|
Scott James Remnant (Canonical) | ||
Trunk |
Fix Released
|
High
|
Scott James Remnant (Canonical) | ||
upstart (Ubuntu) |
Fix Released
|
High
|
Scott James Remnant (Canonical) |
Bug Description
Hi,
We are using Upstart version 0.5.0.
If a job has a respawn stanza and the main process terminates before
post-start script ends, there is a assertion which is causing a kernel
panic.
This does not cause a assertion if the respawn stanza is not present.
Sample Job file:
[/nobackup/
console output
respawn
respawn limit 3 20
normal exit 0
pre-start script
echo "Printing from pre-start script"
end script
script
echo "Printing from main script"
# die.sh will sleep for 2 seconds and exit 100
# The idea is that main process dies before post-start completes.
exec /etc/init/
end script
post-start script
echo "Printing from post-start script"
sleep 5
end script
pre-stop script
echo "Printing from pre-stop script"
end script
post-stop script
echo "Printing from post-stop script"
end script
[/nobackup/
#!/bin/bash
if [ $# -lt 2 ] ;then
echo "Correct syntax is $0 RETCODE SLEEPTIME"
exit 1
fi
retcode=$1
sleeptime=$2
sleep $sleeptime
exit $retcode
Output from /var/log/messages and console are attached
I am working on a fix for this problem. I will send out the patch for review.
Changed in upstart (Ubuntu): | |
assignee: | nobody → Scott James Remnant (scott) |
importance: | Undecided → High |
status: | New → Triaged |
This is happening because the respawn handling code is before the checks for a running post-start script in job_process_ terminated( )
Moving the checks for JOB_POST_START and JOB_PRE_STOP above the respawn checking would be sufficient to avoid the assert()