diff --git a/README.md b/README.md index 0f2aa7b..3ce1448 100644 --- a/README.md +++ b/README.md @@ -266,6 +266,25 @@ pip install -r client/requirements.txt `server/brewpi.sh` shows how this is wired up to run under a `virtualenvwrapper` environment (`$WORKON_HOME`/`$BREWPI_HOME`) on a Raspberry Pi-style deployment. +### Running as a systemd service + +`deploy/install.sh` installs `deploy/brewpi.service` as a systemd unit +(`BREWPI_HOME` is derived from the script's own location, substituted into +the unit via `envsubst`): + +```bash +./deploy/install.sh +sudo systemctl start brewpi +journalctl -u brewpi -f +``` + +`systemctl stop`/`restart` send `SIGTERM`, which `server/brewpi.py` routes +through the same shutdown path as Ctrl-C (`SIGINT`/`KeyboardInterrupt`) - +so a service stop still cancels all tasks, forces the heater to 0 W and the +stirrer to a stopped state (`AHeater`/`AStirrer.activate(False)`, via each +task's `with device.open():`), and flushes the server/sud logs before the +process exits, rather than being killed mid-state. + ## Mash schedules Files under `sude/` describe a brew's mash schedule ("Sud"): `pot_mass`,