krallin / tini

A tiny but valid `init` for containers
MIT License
9.66k stars 505 forks source link

Add an option to restart the child process #186

Open ashishshinde opened 3 years ago

ashishshinde commented 3 years ago

Some applications need to be restarted, for example, to reload the configuration. For various reasons they do not/cannot implement a signal-based graceful reload of configuration.

In containerized environments, containers restart can be costly for applications like databases that would need to scan disk to recreate indices or caches on container delete and restart. For example, the Aerospike NoSQL database stores the indices in shared memory to enable a quick restart and will benefit from restarting within the container without having shared memory segments being lost.

A -r option can be added such that when tini receives this, it terminates and restarts the child process to enable graceful reloads of configuration without losing shared memory or caches stored on ephemeral storage.

yosifkit commented 2 years ago

I think this is "out of scope" for tini: https://github.com/krallin/tini/issues/71#issuecomment-272652178, https://github.com/krallin/tini/pull/146, https://github.com/krallin/tini/pull/187