openvpn-client icon indicating copy to clipboard operation
openvpn-client copied to clipboard

Kill unhealthy

Open red-avtovo opened this issue 5 years ago • 17 comments

Since docker-compose has restart:unless-stopped option I added self-killing healthcheck

red-avtovo avatar Dec 08 '20 22:12 red-avtovo

I don't think this change is a good idea: it introduces unexpected side-effects into the healthcheck.

gynnantonix avatar Dec 09 '20 15:12 gynnantonix

It really does, but what is the point of having unhealthy label without automatic recovery?

red-avtovo avatar Dec 09 '20 15:12 red-avtovo

As another way of doing it I see adding this guy to a docker-compose. https://hub.docker.com/r/willfarrell/autoheal/

red-avtovo avatar Dec 09 '20 15:12 red-avtovo

Sure. If someone who's using this image explicitly wants a management layer that kills unhealthy containers, that's their business. It'd be inappropriate to force that on them by baking such logic into this image, though.

gynnantonix avatar Dec 09 '20 17:12 gynnantonix

Yeah https://hub.docker.com/r/willfarrell/autoheal/ is the way to go. Healthchecks only ever report a status.

luckydonald avatar Dec 10 '20 19:12 luckydonald

Finally found some time to update my PR. I believe this solution worth to be merged

red-avtovo avatar Dec 20 '20 09:12 red-avtovo

Looks good to me. Not sure if AUTOHEAL_CONTAINER_LABEL: all is the best way, or instead the container should get a label instead, so we don't suddenly restart other services on that docker server as well. Maybe @dperson needs to decide that.

luckydonald avatar Jan 05 '21 22:01 luckydonald

@dperson any objections?

red-avtovo avatar Jan 13 '21 14:01 red-avtovo

To elaborate more: I'd prefer having the restart label on that exact container, so it doesn't accidentally kill other containers which might be there before this.

However that would introduce a change to the configuration to the actual image, which might confuse new users. They might think that would be needed for running VPN.

luckydonald avatar Jan 13 '21 14:01 luckydonald

How will killing the container that's hosting the network stack for other containers affect those other containers?

gynnantonix avatar Jan 13 '21 16:01 gynnantonix

After you will restart a network container, all dependent containers will loose network at all. In my setup I restart them as well to update network link to net container. So far it works flawlessly

red-avtovo avatar Jan 13 '21 18:01 red-avtovo

In that case, could it make sense to include that in the docker file as well?

luckydonald avatar Jan 30 '21 23:01 luckydonald

Now only containers with label autoheal=true will be killed

red-avtovo avatar Feb 07 '21 13:02 red-avtovo

I like that. Actually started using autoheal in my own system now as well.

luckydonald avatar Feb 09 '21 18:02 luckydonald

@dperson or someone who is trusted with the merges would need to have a look at it now.

luckydonald avatar Feb 09 '21 18:02 luckydonald

@dperson is there anything I can do to merge this PR?

red-avtovo avatar Mar 17 '21 08:03 red-avtovo

any update with that? its a great idea

martiGIT avatar May 20 '23 11:05 martiGIT