pmux/pmux-example.yml

49 lines
1.5 KiB
YAML
Raw Normal View History

2021-09-21 22:36:50 +00:00
# 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.
2022-02-27 17:37:22 +00:00
#
# If timeFormat isn't set then the time is not included in each log line.
#timeFormat: "2006-01-02T15:04:05.000Z07:00"
2021-09-21 22:36:50 +00: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
2022-02-25 03:48:37 +00:00
dir: "/tmp"
2021-09-21 22:36:50 +00:00
# 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
2021-09-21 22:36:50 +00:00
while ping -c1 example.com; do sleep 1; done
sigKillWait: 1s