I am trying to get an upstart job to start after both 2 other jobs have completed. As an example, I have debug.conf that looks like:
start on stopped networking and stopped screen-cleanup task script date end script
I have added a date call at the end of
screen-cleanup.conf's script, and at the beginning of networking's post-stopped script as well. The time stamps should allow me to see roughly what order things were run in.
I have rebooted several times now and the behaviour seems to be variable. Initially I found that the above "debug" job would run after "networking" but before "screen-cleanup" had finished (based on the date outputs). Since then I have tried various tests and found that similar conditions, but dependent on signals I was sending via
initctl emit (to save me from having to reboot) rather than "stopped", work as expected.
To explore the behaviour at boot more I have created and removed various test jobs and now I find that the "debug" job does not run at all. I copied the conf file to another name and changed the "and" to an "or" and verified that that job does fire twice on boot.
I have looked at the cookbook but I can't see what I'm doing wrong. screen-cleanup is a task as well, if that makes a difference (its the file that came with the screen package apart from my additional call to date).
I'm running 13.10 though I'm hoping for something that works back to 12.04 LTS at worst.
EDIT: and after more reboots I'm back to the job triggering on the first thing to stop (networking), rather than the last (screen-cleanup). I can only assume there is an extra factor I'm not noticing.