added systemd job

This commit is contained in:
Hendrik Schutter 2023-03-02 21:17:12 +01:00
parent dfba150bd6
commit 5ccf70028a
2 changed files with 23 additions and 0 deletions

View File

@ -34,6 +34,14 @@ TTN LoRa frequency / region
`pip3 install paho-mqtt`
- `mkdir /opt/msv-clubhouse-backend/`
- `cd /opt/msv-clubhouse-backend/`
- import `msv_clubhouse_backend.py` and `config.py`
- Set the constants in `config.py`
- `chmod +x /opt/msv-clubhouse-backend/msv_clubhouse_backend.py`
- `chown -R prometheus /opt/msv-clubhouse-backend/`
- `nano /etc/systemd/system/msv-clubhouse-backend.service`
- `systemctl daemon-reload && systemctl enable --now msv-clubhouse-backend.service`
JS Payload Formatter:

View File

@ -0,0 +1,15 @@
[Unit]
Description=MSV-Clubhouse-Backend
After=syslog.target
After=network.target
[Service]
RestartSec=2s
Type=oneshot
User=prometheus
Group=prometheus
WorkingDirectory=/opt/msv-clubhouse-backend/
ExecStart=/usr/bin/python3 /opt/msv-clubhouse-backend/msv_clubhouse_backend.py
[Install]
WantedBy=multi-user.target