- Newest
- Most votes
- Most comments
Hi clogwog,
Thanks for using Greengrass V2. Greengrass automatically restarts components 3 times if the component Run lifecycle processes exits with an error the component goes to ERRORED state. If it doesn't recover in those 3 attempts the component will be put in BROKEN state and won't be auto-restarted, and you will need to deploy a fix for that issue. If you're application crashes and the docker run command exits in this manner your docker component will also be restarted. However, if the error is never reported to greengrass in this way and the docker container keeps running or exits with code 0, then Greengrass will not know about the issue and won't restart. You can check your components log file and greengrass.log file to check if the component follows this path. This is likely what you're looking for since you want to rerun the container when the containerized application crashes.
If you manually stop the container then greengrass does not have knowledge of that, the run command will also finish with 0 exit code in that case which is treated by Greengrass as success.
Another mechanism for restarting a component is via the greengrass cli, but that needs to be done by logging into the device. https://docs.aws.amazon.com/greengrass/v2/developerguide/gg-cli-component.html#component-restart
Please update this thread if that does't address your concern and provide component and container logs
Thanks,
Shagupta
Relevant content
- asked 2 years ago
- AWS OFFICIALUpdated 10 months ago
- AWS OFFICIALUpdated 10 months ago
- AWS OFFICIALUpdated 3 years ago
- AWS OFFICIALUpdated a year ago