Skip to main content

Simple process manager

Project description

Travis CI Status Code Coverage https://badge.fury.io/py/reloadconf.svg

ReloadConf

Simple process manager. Reloadconf is a front-end for arbitrary commands. It will watch a directory for configuration files and optionally run a command to test those configuration files. When the configuration is valid a command (daemon) is executed. Whenever new configuration files are detected this procedure is repeated.

Here is an example usage for nginx.

$ reloadconf --config=/etc/nginx/nginx.conf --command="nginx -g nodaemon: true" --test="nginx -t" --watch=/tmp/nginx

First of all, if /etc/nginx/nginx.conf exists, it will be verified using nginx -t and if successful, nginx will be started. In either case reloadconf will then proceed to watch /tmp/nginx for a file name nginx.conf. If present, that fill will be tested, and a if successful a HUP signal will be sent to nginx (or nginx will be started).

Docker

ReloadConf is generally useful whenever you want a process to recieve a HUP signal after new configuration is written. It was written to be used with docker where one container generates a config file for a process in another container. To use it for this purpose, simply install then utilize reloadconf in your Dockerfile.

# Install reloadconf.
RUN pip install reloadconf

# Map a volume into the container.
VOLUME /mnt/data/nginx/:/conf/

# Watch for another container to modify the conf and reload nginx.
CMD reloadconf --command="nginx -c /conf/nginx.conf -g'nodaemon: true;'" --watch=/conf/in --test="nginx -c /conf/nginx.conf -t" --config=/conf/nginx.conf

Project details


Download files

Download the file for your platform. If you're not sure which to choose, learn more about installing packages.

Source Distribution

reloadconf-1.1.7.tar.gz (5.6 kB view hashes)

Uploaded Source

Supported by

AWS AWS Cloud computing and Security Sponsor Datadog Datadog Monitoring Fastly Fastly CDN Google Google Download Analytics Microsoft Microsoft PSF Sponsor Pingdom Pingdom Monitoring Sentry Sentry Error logging StatusPage StatusPage Status page