Update the systemd details to avoid double monitoring.

This commit is contained in:
Llewellyn van der Merwe 2024-10-29 08:55:51 +02:00
parent 3fb71e247f
commit eef7e4fd9a
Signed by: Llewellyn
GPG Key ID: A9201372263741E7

View File

@ -188,6 +188,8 @@ To automate `octokuma` execution at regular intervals, configure a systemd servi
User=ubuntu
Group=ubuntu
ExecStart=/usr/local/bin/octokuma
ExecStartPre=/bin/sh -c 'if [ -e /var/lock/octokuma-monitoring.lock ]; then echo "Monitoring already in progress."; exit 1; else touch /var/lock/octokuma-monitoring.lock; fi'
ExecStartPost=/bin/rm -f /var/lock/octokuma-monitoring.lock
StandardOutput=append:/home/ubuntu/.local/log/octokuma.log
StandardError=append:/home/ubuntu/.local/log/octokuma.log
```
@ -195,7 +197,7 @@ To automate `octokuma` execution at regular intervals, configure a systemd servi
3. **Save and close the file.**
- `User=ubuntu` and `Group=ubuntu` ensure that the service runs with appropriate permissions.
- Change `ubuntu` to your relevent user name and group name.
- Change `ubuntu` to your relevant user name and group name.
- Logs are directed to `/home/ubuntu/.local/log/octokuma.log`.
### Create and Configure the Timer File
@ -213,9 +215,8 @@ To automate `octokuma` execution at regular intervals, configure a systemd servi
Description=Run OctoKuma Monitoring Service every 5 minutes
[Timer]
OnBootSec=1min
OnUnitActiveSec=5min
Unit=octokuma.service
OnCalendar=*:0/5
Persistent=true
[Install]
WantedBy=timers.target