add systemd example

This commit is contained in:
yggverse 2025-06-08 17:35:58 +03:00
parent 0e613f4d49
commit ab665afc29

View file

@ -85,3 +85,34 @@ htcount --source /var/log/nginx/access.log\
-V, --version
Print version
```
### systemd
``` /etc/systemd/system/htcount.service
#/etc/systemd/system/htcount.service
[Unit]
After=network-online.target
Wants=network-online.target
[Service]
Type=simple
ExecStart=/usr/local/bin/htcount --source /var/log/nginx/access.log\
--export-svg /var/www/htcount/visitors.svg\
--template-svg /path/to/default/template.svg\
--update 3600\
--debug n
StandardOutput=null
StandardError=null
[Install]
WantedBy=multi-user.target
```
* make sure `/var/www/htcount` exists
* replace `/path/to/default/template.svg` with your value
* `systemctl daemon-reload` - update configuration
* `systemctl enable` - launch on system startup
* `systemctl restart htcount` - start systemd service
* `systemctl status htcount` - check if service is running