Run as service on Debian based distro¶
Using systemd¶
Warning
Make sure to follow the instructions to install from binary before.
To create a new service, paste this content in /etc/systemd/system/diun.service
:
[Unit]
Description=Diun
Documentation=https://crazymax.dev/diun/
After=syslog.target
After=network.target
[Service]
RestartSec=2s
Type=simple
User=diun
Group=diun
ExecStart=/usr/local/bin/diun serve --config /etc/diun/diun.yml --log-level info
Restart=always
#Environment=TZ=Europe/Paris
Environment=DIUN_DB_PATH=/var/lib/diun/diun.db
[Install]
WantedBy=multi-user.target
Change the user, group, and other required startup values following your needs.
Enable and start Diun at boot:
sudo systemctl enable diun
sudo systemctl start diun
To view logs:
journalctl -fu diun.service
Last update:
2021-06-25 21:24:02
Created: 2020-06-19 22:47:17
Created: 2020-06-19 22:47:17