I got an home server that is running docker for all my self hosted apps. But sometimes I accidentally trigger Earlyoom by remotely starting expensive docker builds, which kill docker.
I don’t have access to my server outside of my home network, so I can’t manually restart docker in those situations.
What would be the best way to restart it automatically? I don’t mind doing a full system restart if needed
I don’t know the best way but I would use cron and start docker every minute (if it’s not running).
I’ll try that. I know that systemctl has a start-or-reload command, but is there any “start-or-ignore” commands? Or start flags?
Apparently…
Don’t do this. Either don’t go OOM to begin with (somebody else told you how to limit container memory usage} and/or configure systemd to restart docker if it quits. I’m surprised systemd isn’t already.
It’s usually good to state why something is good or bad :)
Seems like the best solution. I’ll look into it
Over using a system tool designed to monitor and restart services that stop?
? I’m agreeing with you?
Sorry - was ambiguous and thought you were saying the “cron” thing sounded best.