balena-os / balena-supervisor

Balena Supervisor: balena's agent on devices.
https://balena.io
Other
148 stars 62 forks source link

Update health-check to restart the supervisor container #1076

Open ZubairLK opened 4 years ago

ZubairLK commented 4 years ago

Currently the Dockerfile has the HEALTHCHECK command but does not ask the engine to attempt to restart the supervisor container if unhealthy.

We are moving this check from the OS into the balenaEngine.

So update to make balenaEngine restart the container if the supervisor is unhealthy.

ZubairLK commented 4 years ago

https://github.com/balena-os/meta-balena/issues/1650

roman-mazur commented 4 years ago

@ZubairLK I believe this needs to be implemented with adding --restart=always to balena run command in the start supervisor script. https://github.com/balena-os/meta-balena/blob/v2.41.0/meta-balena-common/recipes-containers/resin-supervisor/resin-supervisor/start-resin-supervisor#L75

btw, probably it's a good moment to rename balena to balena-engine there

ZubairLK commented 4 years ago

Ah. for some reason, I thought this should live in the Dockerfile. I'll check it out. Thanks @roman-mazur

roman-mazur commented 4 years ago

Yeah, it's not a part of Dockerfile. The engine behavior is that it will restart unhealthy container when restart policy is set to always or on-failure.

robertgzr commented 4 years ago

the meta-balena issue was closed including the appropriate flag to the supervisor container start, should this issue be closed?