pmux/pmux-example.yml
Brian Picciano 05c959eba7 Refactor logging to separate stdout/stdout/system lines
The new logging differentiates between stdout, stderr, and system log
lines much better. The flushing logic has also been simplified, so lines
should appear on the terminal when expected (though possibly with lower
performance, will need to keep an eye on this).
2022-02-27 11:12:26 -07:00

49 lines
1.5 KiB
YAML

# This is an example of a pmux configuration file.
# timeFormat defines the formatting of timestamps. See
# https://pkg.go.dev/time#pkg-constants for more info on how the formatting
# string works.
#
# If timeFormat isn't set then the time is not included in each log line.
#timeFormat: "2006-01-02T15:04:05.000Z07:00"
# processes is the only required field, it must have at least one process
# defined.
processes:
# each process must have a name and cmd.
- name: pinger
cmd: /bin/bash
args:
- "-c"
- while ping -c1 $TARGET; do sleep 1; done
env:
TARGET: example.com
dir: "/tmp"
# pmux uses an exponential backoff when restarting a process, so subsequent
# restarts will each take longer and longer. minWait/maxWait indicate the
# min/max wait times between restarts of this process, respectively.
#
# The values shown here are the defaults if none are given.
minWait: 1s
maxWait: 64s
# once pmux has signalled a process to stop, it will wait this long for the
# process to exit before sending it a SIGKILL (aka a kill -9).
sigKillWait: 10s
# This process will not immediately exit when pmux tells it to do so, but pmux
# will SIGKILL it after sigKillWait has elapsed.
- name: stubborn-pinger
cmd: /bin/bash
args:
- "-c"
- |
trap "echo 'i will never stop, you will have to SIGKILL me!' >&2" SIGINT
while ping -c1 example.com; do sleep 1; done
sigKillWait: 1s