Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
*: Restore hook lifecycle information removed by create/start split
I expect the lifecycle information was removed accidentally in be59415 (Split create and start, 2016-04-01, #384), because for a time it seemed like that PR would also be removing hooks. Putting the lifecycle information back in, I made some tweaks to adjust to the new environment, for example: * Put the pre-start hooks after the 'start' call, but before the meat of the start call (the container-process exec trigger). Folks who want a post-create hook can add one with that name. I'd like to have renamed poststop to post-delete to avoid confusion like [1]. But the motivation for keeping hooks was backwards compatibility [2] so I've left the name alone. * Put each "...command is invoked..." lifecycle entry in its own list entry, to match the 'create' list entry. * Move the rules about what happens on hook failure into the lifecycle. This matches pre-split entries like: If any prestart hook fails, then the container MUST be stopped and the lifecycle continues at step 7. and avoids respecifying that information in a second location (config.md). * I added the warning section to try and follow post-split's generic "generates an error" approach while respecting the pre-split desire to see what failed (we had "then an error including the exit code and the stderr is returned to the caller" and "then an error is logged"). * I left the state 'id' context out, since Michael didn't want it [3]. [1]: #395 Subject: Run post-stop hooks before the container sandbox is deleted. [2]: #483 (comment) Subject: *: Remove hooks [3]: #532 (comment) Subject: Restore hook language removed by create/start split Signed-off-by: W. Trevor King <wking@tremily.us>
- Loading branch information