pmux/pmux-example.yml

45 lines
1.4 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.
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
# 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!'" SIGINT
while ping -c1 example.com; do sleep 1; done
sigKillWait: 1s