- Newest
- Most votes
- Most comments
Hi
For 1, can you elaborate on how you expect your docker component to exit? Greengrass traps any non zero exit code for a component (including docker ones) as errors and that transitions the lifecycle of that component from previous state to ERRORED. Greengrass will attempt to restart an ERRORED component at most twice before reporting its status as BROKEN. I would imagine in your case, your docker component needs to handle exceptions and ensure it exits with a non zero error code that Greengrass can trap.
Please note, Greengrass will not always restart an ERRORED component but only twice at max.
For 2 and 3, your assessment is correct and I would advice you to let Greengrass control a component's lifecycle and not let Docker handle it. However, I do believe you can use the container's file system to your advantage and, if necessary, skip a lifecycle through the component itself. For example, in your STARTUP code, if path A exists, just exit with a success code. Unfortunately, Greengrass does not allow skipping lifecycle states.
Hope this helps!

Thanks for answering :)
What you've described in first paragraph is correct, however, for a
startupscript component is launched and then GG doesn't care about it (until next system restart), so it won't pick up non-zero exit code.It works for a compnnent launched with
runscript, because then GG actually controls if component hasn't exited with non-zero code. I redesigned my components to userunlifecycle and it works as it should now.I'm not sure tho, what's the purpose of
startuplifecycle then, it seems a bit useless. I also believe that docs are misleading.