systemd service

This commit is contained in:
notplants 2023-04-27 14:47:13 +05:30
parent 084ec7df27
commit 6aa3563cad
2 changed files with 30 additions and 0 deletions

View File

@ -0,0 +1,14 @@
# to install required dependencies
```pip install -r requirements.txt```
# to run the telegram bot and listen for commands
```python3 moonlight_analytics.py```
# to run the nightly iperf test
```python3 nightly_test.py```
# to install a systemd service file for the telegram bot
- update moonlight_analytics.service with correct paths
- cp moonlight_analytics.service /etc/systemd/system/
- sudo systemctl enable moonlight_analytics.service
- systemctl status moonlight_analytics.service (to see it running)

View File

@ -0,0 +1,16 @@
[Unit]
Description=moonlight-analytics-telegram-bot
Wants=network.target
After=syslog.target network-online.target
[Service]
Type=simple
Environment="PATH=/datadrive/apps/moonlight_analytics/cowmesh-network-test/moonlight/bin/"
ExecStart=/datadrive/apps/moonlight_analytics/cowmesh-network-test/moonlight/bin/python /datadrive/apps/moonlight_analytics/cowmesh-network-test/moonlight_analytics.py
Restart=always
RestartSec=10
KillMode=process
[Install]
WantedBy=multi-user.target