mirror of
https://github.com/crazy-max/diun.git
synced 2025-12-24 14:31:47 +01:00
Add Linux service doc and sample
This commit is contained in:
17
.res/systemd/diun.service
Normal file
17
.res/systemd/diun.service
Normal file
@@ -0,0 +1,17 @@
|
||||
[Unit]
|
||||
Description=Diun
|
||||
Documentation=https://github.com/crazy-max/diun
|
||||
After=syslog.target
|
||||
After=network.target
|
||||
|
||||
[Service]
|
||||
RestartSec=2s
|
||||
Type=simple
|
||||
User=diun
|
||||
Group=diun
|
||||
ExecStart=/usr/local/bin/diun --config /etc/diun/diun.yml --log-level info
|
||||
Restart=always
|
||||
Environment=DIUN_DB=/var/lib/diun/diun.db
|
||||
|
||||
[Install]
|
||||
WantedBy=multi-user.target
|
||||
28
doc/install/linux-service.md
Normal file
28
doc/install/linux-service.md
Normal file
@@ -0,0 +1,28 @@
|
||||
# Run as service on Debian based distro
|
||||
|
||||
## Using systemd
|
||||
|
||||
> :warning: Make sure to follow the instructions to [install from binary](binary.md) before.
|
||||
|
||||
Run the below command in a terminal:
|
||||
|
||||
```
|
||||
sudo vim /etc/systemd/system/diun.service
|
||||
```
|
||||
|
||||
Copy the sample [diun.service](../../.res/systemd/diun.service).
|
||||
|
||||
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
|
||||
```
|
||||
Reference in New Issue
Block a user