diff --git a/configs/mqttproxy.service b/configs/mqttproxy.service new file mode 100644 index 00000000..751cf6cb --- /dev/null +++ b/configs/mqttproxy.service @@ -0,0 +1,26 @@ +# This unit file is used to launch the mqttproxy scripts on boot. +# Symlink it with `ln -s configs/mqttproxy.service +# /etc/systemd/system/mqttproxy.service` before using. +# Use e.g. `systemctl enable mqttproxy.service` +# to enable the service. +# Once symlinked and enabled for each sensor, the services will +# start automatically on boot. +# They can be controlled with `start`/`stop`/`restart`/`status`. +# Use e.g. `journalctl -u mqttproxy.service -f` to +# see the script output. + +[Unit] +Description= mqttproxy (sending data to mqtt.simoc.space) service +After=network.target + +[Service] +User=pi +WorkingDirectory=/home/pi/simoc-sam +Environment=PYTHONUNBUFFERED=1 +ExecStart=/home/pi/simoc-sam/venv/bin/python -m simoc_sam.mqttproxy +Restart=always +StandardOutput=journal +StandardError=journal + +[Install] +WantedBy=multi-user.target