![]() |
Utilities for robust launcher and process life-cycle management scripts. |
---|---|
Project | |
QA | |
Release | |
Bootils offers process boot-strapping utilities that support writing
robust application/service launcher and process life-cycle management scripts.
It is comprised of a bootils
Python package with building blocks
for process and resource management, and a CLI tool named nanny
that
watches your child process after starting, until it grows up
into a stable running state.
📚 | For more details, see the full documentation at Read The Docs. |
---|
Refer to the Installation Guide on Read The Docs.
See Contributing on how to create a full development environment.
nanny
can launch an application or service based on an
INI-style configuration file.
The following is a hopefully pretty much self-explanatory and totally made up example.
[launcher]
java-classpath = """
/usr/share/java/commons-logging*.jar
/usr/share/java/log4j*.jar
"""
java-agents = """
/usr/share/java/jmx/jolokia-jvm-agent.jar=config=/etc/cassandra/jolokia-config.properties
"""
launch = """
wait_for:port:12345
timeout:120s
jsw:StartStopApp:/usr/lib/cassandra/cassandra.jar
"""
[post-check]
logscan = """
timeout:90s
success:Started in [0-9]+ msec
warn:Exception
warn:WARNING: Could not open
fail:OutOfMemory
file:/var/log/cassandra/demon.log
"""
commands = """
after:10s
detach:/usr/sbin/jolocas watchdog
after:60s
call:/usr/sbin/nodetool status | grep '^U.* ${env:FACTER_IPV4} '
call:/usr/sbin/jolocas check health
"""
The pre and post checks can also be called explicitely (via the
pre-check
and post-check
sub-commands), to support some
outside process launcher. In this case, the checks are performed
as per config, and the return code reflects the outcome
(0
for OK, and 1
for failures).
Contributing to this project is easy, and reporting an issue or adding to the documentation also improves things for every user. You don’t need to be a developer to contribute. See CONTRIBUTING for more.
As a documentation author or developer, to create a working directory for this project, call these commands:
git clone "https://github.com/Build-The-Web/bootils.git"
cd "bootils"
. .env --yes --develop
invoke build --docs test check
You might also need to follow some setup procedures to make the necessary basic commands available on Linux, Mac OS X, and Windows.
- testinfra – Write unit tests with pytest to validate the actual state of your servers configured by CM tools.
- procdog – Lightweight command-line process control.
- mirakuru – Starts a process, and waits for clear indication that it's running.
- ianitor – Doorkeeper for Consul discovered services.
- supervisor
- honcho
- runit
- systemd
- upstart
- runc
- dinit
Project sponsored by 1&1.
Documentation hosted by Read the Docs.