summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorPierre-Olivier Mercier <nemunaire@nemunai.re>2017-08-16 13:37:28 +0200
committerMichał Górny <mgorny@gentoo.org>2017-08-22 11:07:01 +0200
commit91cdae70f2fa6322ff9b38336b24312bdd3c3810 (patch)
tree78c074ebd0153c7d5dfde1eced5e7535dd68d0fe /net-dns/knot
parentnet-dns/knot: Add dependency to dev-python/lmdb (diff)
downloadgentoo-91cdae70f2fa6322ff9b38336b24312bdd3c3810.tar.gz
gentoo-91cdae70f2fa6322ff9b38336b24312bdd3c3810.tar.bz2
gentoo-91cdae70f2fa6322ff9b38336b24312bdd3c3810.zip
net-dns/knot: enhance systemd service security
Suggested-by: hexumg <hexumg@gmail.com> Bug: https://bugs.gentoo.org/606644
Diffstat (limited to 'net-dns/knot')
-rw-r--r--net-dns/knot/files/knot-1.service17
-rw-r--r--net-dns/knot/knot-2.5.3-r1.ebuild6
2 files changed, 21 insertions, 2 deletions
diff --git a/net-dns/knot/files/knot-1.service b/net-dns/knot/files/knot-1.service
new file mode 100644
index 000000000000..14a34a2b211f
--- /dev/null
+++ b/net-dns/knot/files/knot-1.service
@@ -0,0 +1,17 @@
+[Unit]
+Description=Knot high-performance DNS Server
+After=network.target
+
+[Service]
+ExecStart=/usr/sbin/knotd
+ExecReload=/usr/sbin/knotc reload
+ExecStop=/usr/sbin/knotc stop
+PrivateTmp=true
+User=knot
+Group=knot
+RuntimeDirectory=knot
+RuntimeDirectoryMode=750
+AmbientCapabilities=CAP_NET_BIND_SERVICE
+
+[Install]
+WantedBy=multi-user.target
diff --git a/net-dns/knot/knot-2.5.3-r1.ebuild b/net-dns/knot/knot-2.5.3-r1.ebuild
index d9263f9e8498..5d116b1a44c4 100644
--- a/net-dns/knot/knot-2.5.3-r1.ebuild
+++ b/net-dns/knot/knot-2.5.3-r1.ebuild
@@ -26,7 +26,7 @@ RDEPEND="
)
idn? ( || ( net-dns/libidn >=net-dns/libidn2-2.0.0 ) )
dev-libs/libedit
- systemd? ( sys-apps/systemd )
+ systemd? ( >=sys-apps/systemd-229 )
"
DEPEND="${RDEPEND}
virtual/pkgconfig
@@ -66,7 +66,9 @@ src_install() {
keepdir /var/lib/${PN}
newinitd "${FILESDIR}/knot.init" knot
- systemd_dounit "${FILESDIR}/knot.service"
+ if use systemd; then
+ systemd_newunit "${FILESDIR}/knot-1.service" knot
+ fi
find "${D}" -name '*.la' -delete || die
}