a minimal supervisor
Beatflip is a minimal supervisor tailored to single-process applications. It comes with the following features:
- 💚 Process uptime: monitors processes and restarts them if exited
- 🧃 OTA updates: downloads newer versions against an update-server / S3 bucket, flips & restarts binaries
- 📮 Log handling: forwards process output
To install / update beatflip run
go install github.com/wakurobotics/beatflip@latest
git clone github.com/wakurobotics/beatflip && cd beatflip
docker build -t wakurobotics/beatflip .
docker run wakurobotics/beatflip --help
$ beatflip --help
Usage:
beatflip [command]
Available Commands:
completion Generate the autocompletion script for the specified shell
help Help about any command
init initialize a new configuration file in the current directoey
supervise
version
Flags:
--config string config file (default is '.beatflip.yml')
-h, --help help for beatflip
Use "beatflip [command] --help" for more information about a command.
Initialize a new configuration file.
Start the supervisor mode.
You can initialize a new configuration file via beatflip init
.
By default, Beatflip looks for a config file named .beatflip.yml
in the current working directory. This can be overridden via the --config
flag.
For a full example of the configuration file, please have a look at https://github.com/wakurobotics/beatflip/raw/master/cmd/.beatflip.yml
.
Sending a SIGINT or SIGTERM to beatflip causes the supervisor to first terminate the supervised process by forwarding the respective signal, then terminating itself.
Sending a SIGHUB to the supervisor causes it to restart a currently running process.
beatflip supervise &
PID=$!
kill -HUP $PID # --> supervised process will be restarted