A simple process supervisor written in Go.
Paladin is a simple way to launch and maintain services. It provides the following features:
- Simple TOML configuration.
- Automatically restart failed processes.
- Log each process to a different file, even separating stdout and stderr.
- Specify process dependencies, so things start in the right order.
- Launch processes under different users and groups.
- Clone this repo in your
/etc/paladin.confand set your values.
paldinin your path.
Compile with something like
-ldflags="-X main.localbase=/usr/local" on
systems where the config file will not live under
/etc, such as FreeBSD.
This code is under the BSD-2-Clause license. See the LICENSE file for the full text.
The config file uses TOML format. It consists of general options, and several
[[process]] blocks that define each process that paladin is responsible for.
The following general options do not go inside a TOML block:
||N||File path for main output. An empty string means stderr.|
The following options are per-process, and go in a
||Y||Used to identify the process. Must be unique.|
||Y||The full path to the program to be run.|
||N||An array of string arguments for the process.|
||N||The current working directory for the process.|
||N||The file path for logging stdout.|
||N||The file path for logging stderr. Follows stdout if unset.|
||N||Run the process as this user.|
||N||Run the process as this group.|
||N||Milliseconds to wait before restarting.|
||N||Boolean. Set to
||N||Don't restart if it fails in fewer than this many milliseconds.|
||N||List of processes that must be started before this one.|
log_file = "/var/log/paladin.log" [[process]] name = "my-program" path = "/path/to/my-program" args =  cwd = "/path/to" restart_delay = 1000 min_runtime = 100 stdout = "/tmp/my-program-stdout" user = "myuser" group = "mygroup" [[process]] name = "my-other-program" path = "/path/to/my-other-program" args = ["-a", "-d"] min_runtime = 100 soft_depends = [ "my-program" ] restart_delay = 1000
||N||The config file to use. Defaults to /etc/paladin.conf (unless localbase is set).|