https://github.com/wakurobotics/beatflip
beatflip - a minimal supervisor :fairy:
https://github.com/wakurobotics/beatflip
ota ota-update process-control process-management supervisor
Last synced: about 2 months ago
JSON representation
beatflip - a minimal supervisor :fairy:
- Host: GitHub
- URL: https://github.com/wakurobotics/beatflip
- Owner: wakurobotics
- License: mit
- Created: 2023-11-17T14:12:02.000Z (over 2 years ago)
- Default Branch: master
- Last Pushed: 2024-02-07T10:45:55.000Z (about 2 years ago)
- Last Synced: 2024-06-21T08:28:53.736Z (over 1 year ago)
- Topics: ota, ota-update, process-control, process-management, supervisor
- Language: Go
- Homepage:
- Size: 3.02 MB
- Stars: 4
- Watchers: 4
- Forks: 0
- Open Issues: 0
-
Metadata Files:
- Readme: README.md
- License: LICENSE
Awesome Lists containing this project
README
[](https://github.com/wakurobotics/beatflip/actions/workflows/tests.yml) [](https://github.com/wakurobotics/beatflip/releases/latest/download/beatflip-windows-amd64.exe) [](https://github.com/wakurobotics/beatflip/releases/latest/download/beatflip-macos-amd64) [](https://github.com/wakurobotics/beatflip/releases/latest/download/beatflip-linux-amd64) [](https://github.com/wakurobotics/beatflip/releases/latest/download/beatflip-linux-arm)
# beatflip :fairy:
> a minimal supervisor
Beatflip is a minimal supervisor tailored to single-process applications. It comes with the following features:
- :green_heart: **Process uptime**: monitors processes and restarts them if exited
- :beverage_box: **OTA updates**: downloads newer versions against an update-server / S3 bucket, flips & restarts binaries
- :postbox: **Log handling**: forwards process output
## Installation
To install / update beatflip run
```bash
go install github.com/wakurobotics/beatflip@latest
```
### Docker
```bash
git clone github.com/wakurobotics/beatflip && cd beatflip
docker build -t wakurobotics/beatflip .
docker run wakurobotics/beatflip --help
```
## Usage
```bash
$ 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.
```
### beatflip init
Initialize a new configuration file.
### beatflip supervise
Start the supervisor mode.
## Config-File
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`](https://github.com/wakurobotics/beatflip/raw/master/cmd/.beatflip.yml).
## OS Signals
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.
```bash
beatflip supervise &
PID=$!
kill -HUP $PID # --> supervised process will be restarted
```