setting up service
This commit is contained in:
@@ -442,11 +442,9 @@ To run it automatically as a user service, copy the supplied service file. It
|
||||
assumes this repository is located at `$HOME/service_zigbee`:
|
||||
|
||||
```bash
|
||||
mkdir -p "$HOME/.config/systemd/user"
|
||||
cp zigbee-rrd.service.example "$HOME/.config/systemd/user/zigbee-rrd.service"
|
||||
cp zigbee-sensor.service.example /etc/systemd/system
|
||||
systemctl --user daemon-reload
|
||||
systemctl --user enable --now zigbee-rrd.service
|
||||
sudo loginctl enable-linger "$USER"
|
||||
systemctl --user enable --now zigbee-sensor.service
|
||||
```
|
||||
|
||||
Inspect its status and live logs with:
|
||||
|
||||
@@ -5,8 +5,8 @@ After=network-online.target
|
||||
|
||||
[Service]
|
||||
Type=simple
|
||||
WorkingDirectory=%h/service_zigbee
|
||||
ExecStart=%h/service_zigbee/.venv/bin/python %h/service_zigbee/read_temperature.py
|
||||
WorkingDirectory=/opt/service_zigbee
|
||||
ExecStart=/opt/service_zigbee/.venv/bin/python /opt/service_zigbee/read_temperature.py
|
||||
Restart=on-failure
|
||||
RestartSec=15
|
||||
|
||||
Reference in New Issue
Block a user