summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorEvgeny Zinoviev <me@ch1p.io>2021-05-06 02:32:37 +0300
committerEvgeny Zinoviev <me@ch1p.io>2021-05-06 02:32:37 +0300
commita62e151a53ba82dd314343528652a62c127dd05b (patch)
treefc9723072c3b40ee58e1b3c3401082816250e299
parente2096cfaf1d62d9e5086e4b7ae9a4708b8483622 (diff)
add systemd service example
-rw-r--r--README.md27
1 files changed, 27 insertions, 0 deletions
diff --git a/README.md b/README.md
index 752e17e..361ba29 100644
--- a/README.md
+++ b/README.md
@@ -25,6 +25,33 @@ use_sudo=0
Only users in `admins` are allowed to use the bot.
+## Launching with systemd
+
+Create a service file `/etc/systemd/system/inverter-bot.service` with the following content (changing stuff like paths):
+
+```systemd
+[Unit]
+Description=inverter bot
+After=network.target
+
+[Service]
+User=user
+Group=user
+Restart=on-failure
+ExecStart=python3 /home/user/inverter-bot/main.py
+WorkingDirectory=/home/user/inverter-bot
+
+[Install]
+WantedBy=multi-user.target
+```
+
+Then enable and start the service:
+```
+systemctl daemon-reload
+systemctl enable inverter-bot
+systemctl start inverter-bot
+```
+
## License
BSD-2c