pmux/pmux-example.yml

57 lines
1.7 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.
pinger:
2021-09-21 22:36:50 +00:00
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
2024-07-19 13:49:13 +00:00
# group can be used to control the order and grouping of processes as they
# shut down.
#
# Processes will not be shut down until all processes with a higher group
# number are already shut down. Processes with the same group number will be
# shut down simultaneously.
group: 1
2021-09-21 22:36:50 +00:00
# This process will not immediately exit when pmux tells it to do so, but pmux
# will SIGKILL it after sigKillWait has elapsed.
stubborn-pinger:
2021-09-21 22:36:50 +00:00
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