From 3b3fbd78327a06c80e3c61504d61d35579c9c288 Mon Sep 17 00:00:00 2001 From: Xuanwo Date: Mon, 3 Jun 2019 21:24:33 +0800 Subject: [PATCH] Set coredns's homedir to /var/lib/coredns (#175) --- systemd/README.md | 9 ++++++--- systemd/coredns-sysusers.conf | 2 +- systemd/coredns-tmpfiles.conf | 1 + 3 files changed, 8 insertions(+), 4 deletions(-) create mode 100644 systemd/coredns-tmpfiles.conf diff --git a/systemd/README.md b/systemd/README.md index 3cc7c9b..1998213 100644 --- a/systemd/README.md +++ b/systemd/README.md @@ -4,6 +4,9 @@ Use `coredns.service` as a systemd service file. It defaults to using a "coredns a homedir of `/var/lib/coredns` and the binary lives in `/usr/bin` and the config in `/etc/coredns/Corefile`. -In order to work, the systemd unit needs a user named `coredns`, an handy way to provide -it is to use the `systemd-sysusers` service by installing the `coredns-sysusers.conf` file in the -`sysusers.d` folder (e.g: `/usr/lib/sysusers.d`). +In order to work, you need to do following jobs: + +- Put `coredns` binary in `/usr/bin` +- Put `Corefile` at `/etc/coredns/Corefile` +- Put `coredns-sysusers.conf` in `/usr/lib/sysusers.d` +- Put `coredns-tmpfiles.conf` in `/usr/lib/tmpfiles.d` diff --git a/systemd/coredns-sysusers.conf b/systemd/coredns-sysusers.conf index 4206b12..8bdc16c 100644 --- a/systemd/coredns-sysusers.conf +++ b/systemd/coredns-sysusers.conf @@ -1 +1 @@ -u coredns - "CoreDNS is a DNS server that chains plugins " / +u coredns - "CoreDNS is a DNS server that chains plugins" /var/lib/coredns diff --git a/systemd/coredns-tmpfiles.conf b/systemd/coredns-tmpfiles.conf new file mode 100644 index 0000000..9f7c82a --- /dev/null +++ b/systemd/coredns-tmpfiles.conf @@ -0,0 +1 @@ +d /var/lib/coredns 0755 coredns coredns -