openshift / geard

geard is no longer maintained - see OpenShift 3 and Kubernetes
Other
405 stars 80 forks source link

Configure units to automatically restart under certain failure conditions #255

Open wallrj opened 10 years ago

wallrj commented 10 years ago

We'd like to be able to configure units to automatically restart under certain failure conditions.

Eg

That last problem may also be addressed by the docker readiness notification idea in this PR https://github.com/openshift/geard/pull/175

The idea of recommending the systemd restart feature by default is described here:

See:

smarterclayton commented 10 years ago

Is there a max restart limit that would make sense for all containers (ie something that would be a good default)?

wallrj commented 10 years ago

Sorry for delayed reply.

I can't see a "max restart limit" option. There's http://www.freedesktop.org/software/systemd/man/systemd.service.html#StartLimitInterval=

Supervisord sets a default maximum restart limit of 3 http://supervisord.org/configuration.html#program-x-section-settings

Twisted Procmon doesn't implement a max restart limit; it just allows you to limit the rate with a backoff algorithm. https://twistedmatrix.com/documents/current/api/twisted.runner.procmon.ProcessMonitor.html

Also worth noting that Docker (1.2.0) now has a "restart policy" feature which continues to attempt restarts indefinitely....but with a backoff: