how to detect stopping reason in post-stop?
I have something like this:
start on started <dependency>
stop on stopping <dependency>
script
<do lots of things here, including starting the actual service via a number of layers>
end script
pre-stop script
<do stuff to kill the service>
end script
post-stop script
if [ <normal stop> ]
then
# this shall be normal stopping on stopped dependency - do nothing
else
# this shall be a failed service - reboot the system!
fi
end script
Is there anything in Upstart that'd help me to detect in post-stop if it was Upstart that stopped me (via explicit stop command or by "stop on stopping" event) or if it was my service panicing and exiting the main script that caused post-stop to run?
I know in pre-start that it's the normal stopping. How can I transfer this knowledge to post-start by means of Upstart?
Question information
- Language:
- English Edit question
- Status:
- Solved
- For:
- upstart Edit question
- Assignee:
- No assignee Edit question
- Solved by:
- Scott James Remnant (Canonical)
- Solved:
- Last query:
- Last reply: