Add systemd service example file
This commit is contained in:
parent
ef7cb7788f
commit
069b61ff15
1 changed files with 26 additions and 0 deletions
26
README.md
26
README.md
|
@ -99,3 +99,29 @@ All the above examples are possible with the *current* CoreDNS.
|
||||||
## Blog
|
## Blog
|
||||||
|
|
||||||
<https://miek.nl/tags/coredns/>
|
<https://miek.nl/tags/coredns/>
|
||||||
|
|
||||||
|
## Systemd service file
|
||||||
|
|
||||||
|
Use this as a systemd service file. It defaults to a coredns wich a homedir of /home/coredns
|
||||||
|
and the binary lives in /opt/bin:
|
||||||
|
|
||||||
|
~~~ txt
|
||||||
|
Unit]
|
||||||
|
Description=CoreDNS DNS server
|
||||||
|
Documentation=https://miek.nl/tags/coredns
|
||||||
|
After=network.target
|
||||||
|
|
||||||
|
[Service]
|
||||||
|
PermissionsStartOnly=true
|
||||||
|
PIDFile=/home/coredns/coredns.pid
|
||||||
|
LimitNOFILE=8192
|
||||||
|
User=coredns
|
||||||
|
WorkingDirectory=/home/coredns
|
||||||
|
ExecStartPre=/sbin/setcap cap_net_bind_service=+ep /opt/bin/coredns
|
||||||
|
ExecStart=/opt/bin/coredns -pidfile /home/coredns/coredns.pid -conf=/etc/coredns
|
||||||
|
/Corefile
|
||||||
|
Restart=on-failure
|
||||||
|
|
||||||
|
[Install]
|
||||||
|
WantedBy=multi-user.target
|
||||||
|
~~~
|
||||||
|
|
Loading…
Add table
Reference in a new issue