net-dns/getdns: add systemd unit files
authorQuentin Retornaz <caseoffr@outlook.com>
Wed, 25 Apr 2018 19:56:18 +0000 (21:56 +0200)
committerAnthony G. Basile <blueness@gentoo.org>
Thu, 26 Apr 2018 00:26:38 +0000 (20:26 -0400)
Signed-off-by: Anthony G. Basile <blueness@gentoo.org>
net-dns/getdns/files/stubby.systemd [new file with mode: 0644]
net-dns/getdns/files/stubby.tmpfilesd [new file with mode: 0644]
net-dns/getdns/getdns-1.4.1-r1.ebuild [moved from net-dns/getdns/getdns-1.4.1.ebuild with 91% similarity]

diff --git a/net-dns/getdns/files/stubby.systemd b/net-dns/getdns/files/stubby.systemd
new file mode 100644 (file)
index 0000000..b85b8e9
--- /dev/null
@@ -0,0 +1,12 @@
+[Unit]
+Description=stubby DNS resolver
+
+[Service]
+WorkingDirectory=/run/stubby
+ExecStart=/usr/bin/stubby
+AmbientCapabilities=CAP_NET_BIND_SERVICE
+CapabilityBoundingSet=CAP_NET_BIND_SERVICE
+User=stubby
+
+[Install]
+WantedBy=multi-user.target
diff --git a/net-dns/getdns/files/stubby.tmpfilesd b/net-dns/getdns/files/stubby.tmpfilesd
new file mode 100644 (file)
index 0000000..bf70492
--- /dev/null
@@ -0,0 +1,2 @@
+# tmpfiles.d (5) for use with stubby.service
+d /run/stubby 0750 root stubby - -
similarity index 91%
rename from net-dns/getdns/getdns-1.4.1.ebuild
rename to net-dns/getdns/getdns-1.4.1-r1.ebuild
index 699abdbc82fa57f26ebe05a50ac8241e48863113..db4a0afb74a6a0e90c49cf5ac09cf0509a5338a0 100644 (file)
@@ -3,7 +3,7 @@
 
 EAPI=6
 
-inherit user fcaps
+inherit user fcaps systemd
 
 DESCRIPTION="Modern asynchronous DNS API"
 HOMEPAGE="https://getdnsapi.net/"
@@ -52,6 +52,8 @@ src_install() {
        if use stubby; then
                newinitd "${FILESDIR}"/stubby.initd stubby
                newconfd "${FILESDIR}"/stubby.confd stubby
+               systemd_newunit "${FILESDIR}"/stubby.systemd stubby.service
+               systemd_newtmpfilesd "${FILESDIR}"/stubby.tmpfilesd stubby.conf
        fi
 }