aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorGravatar Miek Gieben <miek@miek.nl> 2016-05-03 09:00:25 +0000
committerGravatar Miek Gieben <miek@miek.nl> 2016-05-03 09:00:25 +0000
commit069b61ff15a3e6ae416c4c9b09273f7fbcb15cd8 (patch)
treec8880f06a2eede31c2df3c8160117f88763b4fe2
parentef7cb7788f34c864bb6dc149030eeb539a1ed562 (diff)
downloadcoredns-069b61ff15a3e6ae416c4c9b09273f7fbcb15cd8.tar.gz
coredns-069b61ff15a3e6ae416c4c9b09273f7fbcb15cd8.tar.zst
coredns-069b61ff15a3e6ae416c4c9b09273f7fbcb15cd8.zip
Add systemd service example file
-rw-r--r--README.md26
1 files changed, 26 insertions, 0 deletions
diff --git a/README.md b/README.md
index 6129607e4..35b9b79c5 100644
--- a/README.md
+++ b/README.md
@@ -99,3 +99,29 @@ All the above examples are possible with the *current* CoreDNS.
## Blog
<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
+~~~