- Newest
- Most votes
- Most comments
Hi, can you try forwarding signals to the container itself?
Add --sig-proxy=true to your run command. You can remove the shutdown phase.
answered 4 years ago
Hi!
You're on the right approach. In the recipe file above, you are mixing Run with Shutdown. Run stands on its own and is good for foreground processes. But in that case, you must honor and process the SIGTERM received.
With Shutdown you would use Startup instead of Run. For that, Startup would do a docker run -d --name CONTAINER_NAME and name the container, while Shutdown would do a docker stop CONTAINER_NAME.
In summary, Run requires you to run the component in foreground and process SIGTERMs when Greengrass issues a stop to the component. Startup and Shutdown require a exit code of 0 for each, and your Shutdown process would need to know the running container (or process).
HTH!
answered 4 years ago

Thanks for the response. Doesn't work unfortunately, I still have 2 containers running. I realized this happens when a new version of the docker container is published to ECR and then deployed.
Is your process able to process the SIGTERM which is sent by Greengrass? What happens when
docker stopis run during shutdown?