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`:
|
assumes this repository is located at `$HOME/service_zigbee`:
|
||||||
|
|
||||||
```bash
|
```bash
|
||||||
mkdir -p "$HOME/.config/systemd/user"
|
cp zigbee-sensor.service.example /etc/systemd/system
|
||||||
cp zigbee-rrd.service.example "$HOME/.config/systemd/user/zigbee-rrd.service"
|
|
||||||
systemctl --user daemon-reload
|
systemctl --user daemon-reload
|
||||||
systemctl --user enable --now zigbee-rrd.service
|
systemctl --user enable --now zigbee-sensor.service
|
||||||
sudo loginctl enable-linger "$USER"
|
|
||||||
```
|
```
|
||||||
|
|
||||||
Inspect its status and live logs with:
|
Inspect its status and live logs with:
|
||||||
|
|||||||
@@ -5,8 +5,8 @@ After=network-online.target
|
|||||||
|
|
||||||
[Service]
|
[Service]
|
||||||
Type=simple
|
Type=simple
|
||||||
WorkingDirectory=%h/service_zigbee
|
WorkingDirectory=/opt/service_zigbee
|
||||||
ExecStart=%h/service_zigbee/.venv/bin/python %h/service_zigbee/read_temperature.py
|
ExecStart=/opt/service_zigbee/.venv/bin/python /opt/service_zigbee/read_temperature.py
|
||||||
Restart=on-failure
|
Restart=on-failure
|
||||||
RestartSec=15
|
RestartSec=15
|
||||||
|
|
||||||
Reference in New Issue
Block a user