NColony is a system to control and monitor a number of processes on UNIX-like systems. Its primary use-case is to run servers, and it is specifically optimized to container architectures like Docker.
$ python -m virtualenv venv $ venv/bin/python -m pip install ncolony
When running other python processes with ncolony, it is possible to either run them from the ncolony virtual environment or from a separate virtual environment.
For more options with pip installation, for example for network-less install, see the pip documentation.
The process monitor is called as the "ncolony" twistd plugin. It starts processes, and continuously monitors both process state and configuration, and makes sure they are in sync.
The monitor configuration is a directory with a file per process. It also monitors a messages directory with "ephemeral" configuration: mostly restart requests.
This plugin, intended to be run under the ncolony monitor, will look at other processes' configuration, check if they are supposed to beat hearts (periodically touch a file) and message ncolony with a restart request if the heart does not beat for too long.
This plugin, intended to be run under the ncolony monitor, will periodically run a short-lived process. This allows the main ncolony plugin to assume all of its processes are long-lived, while still supporting short-lived processes. This is useful, e.g., for log-rotation or other periodic clean-up tasks.
Control program -- add, remove and restart processes.