systemd service template & README configuration explanation

This commit is contained in:
2025-08-02 12:58:33 +02:00
parent f3bc1c5707
commit a2bf28da8e
2 changed files with 28 additions and 0 deletions

View File

@@ -48,4 +48,18 @@ Install python dependencies:
pip3 install -r requirements.txt
```
## Setup systemd service
Copy the systemd template & activate it:
```bash
(sudo) cp templates/keyboard-autostart.service /etc/systemd/system/
(sudo) systemctl enable keyboard-autostart.service
(sudo) systemctl start keyboard-autostart.service
```
### View application logs
```
(sudo) journalctl -u keyboard-autostart.service
```

View File

@@ -0,0 +1,14 @@
[Unit]
Description=Keyboard autostart service
After=multi-user.target
[Service]
Type=simple
Restart=always
RestartSec=5s
ExecStart=/opt/keyboard-autostart/env/bin/python3 -u /opt/keyboard-autostart/main.py
[Install]
WantedBy=multi-user.target
RequiredBy=network.target