summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorQuentin Retornaz <caseoffr@outlook.com>2018-04-27 22:28:49 +0200
committerAnthony G. Basile <blueness@gentoo.org>2018-04-28 06:50:45 -0400
commit54db0fef68b5dbc5c304bdc2ca7b1440291ca66c (patch)
treec373ca6d77ac87eddebf5a051db251458e6929bc /net-dns/getdns
parentsys-libs/rvm: stable 1.17-r1 for ia64, bug #654100 (diff)
downloadgentoo-54db0fef68b5dbc5c304bdc2ca7b1440291ca66c.tar.gz
gentoo-54db0fef68b5dbc5c304bdc2ca7b1440291ca66c.tar.bz2
gentoo-54db0fef68b5dbc5c304bdc2ca7b1440291ca66c.zip
net-dns/getdns: improved stubby initd/confd for logs and logrotate
Diffstat (limited to 'net-dns/getdns')
-rw-r--r--net-dns/getdns/files/stubby.confd4
-rw-r--r--net-dns/getdns/files/stubby.confd-r116
-rwxr-xr-xnet-dns/getdns/files/stubby.initd-r1 (renamed from net-dns/getdns/files/stubby.initd)4
-rw-r--r--net-dns/getdns/files/stubby.logrotate7
-rw-r--r--net-dns/getdns/getdns-1.4.1-r2.ebuild (renamed from net-dns/getdns/getdns-1.4.1-r1.ebuild)6
5 files changed, 30 insertions, 7 deletions
diff --git a/net-dns/getdns/files/stubby.confd b/net-dns/getdns/files/stubby.confd
deleted file mode 100644
index b862ea4a40d7..000000000000
--- a/net-dns/getdns/files/stubby.confd
+++ /dev/null
@@ -1,4 +0,0 @@
-# /etc/conf.d/stubby: config file for /etc/init.d/stubby
-
-# See stubby -h for possible options to put here.
-STUBBY_OPTS=""
diff --git a/net-dns/getdns/files/stubby.confd-r1 b/net-dns/getdns/files/stubby.confd-r1
new file mode 100644
index 000000000000..9c8d83f07f79
--- /dev/null
+++ b/net-dns/getdns/files/stubby.confd-r1
@@ -0,0 +1,16 @@
+# /etc/conf.d/stubby: config file for /etc/init.d/stubby
+
+# Enter here Stubby YAML configuration file to use.
+STUBBY_CONFIG_FILE="/etc/stubby/stubby.yml"
+
+# Set here Stubby log level to use.
+# Following log levels are available:
+# 0: EMERG - System is unusable
+# 1: ALERT - Action must be taken immediately
+# 2: CRIT - Critical conditions
+# 3: ERROR - Error conditions
+# 4: WARN - Warning conditions
+# 5: NOTICE - Normal, but significant, condition
+# 6: INFO - Informational message
+# 7: DEBUG - Debug-level message
+STUBBY_LOGLEVEL="5"
diff --git a/net-dns/getdns/files/stubby.initd b/net-dns/getdns/files/stubby.initd-r1
index 170db9be07fe..e6b799919e28 100755
--- a/net-dns/getdns/files/stubby.initd
+++ b/net-dns/getdns/files/stubby.initd-r1
@@ -2,8 +2,9 @@
# Copyright 1999-2018 Gentoo Foundation
# Distributed under the terms of the GNU General Public License, v2 or later
+stubby_opts="-C ${STUBBY_CONFIG_FILE:-/etc/stubby/stubby.yml} -v ${STUBBY_LOGLEVEL:-5}"
command="capsh"
-command_args="--inh=cap_net_bind_service --user=stubby -- -c '/usr/bin/stubby -g ${STUBBY_OPTS}'"
+command_args="--inh=cap_net_bind_service --user=stubby -- -c '/usr/bin/stubby -g ${stubby_opts} >>/var/log/stubby.log 2>&1'"
pidfile="/var/run/stubby/stubby.pid"
name="DNS Privacy Daemon"
@@ -18,4 +19,5 @@ depend()
start_pre()
{
checkpath -d -m 1755 -o stubby:stubby /var/run/stubby
+ checkpath -f -m 0644 -o stubby:stubby /var/log/stubby.log
}
diff --git a/net-dns/getdns/files/stubby.logrotate b/net-dns/getdns/files/stubby.logrotate
new file mode 100644
index 000000000000..48058782594c
--- /dev/null
+++ b/net-dns/getdns/files/stubby.logrotate
@@ -0,0 +1,7 @@
+/var/log/stubby.log {
+ rotate 4
+ compress
+ size 200k
+ noolddir
+ missingok
+}
diff --git a/net-dns/getdns/getdns-1.4.1-r1.ebuild b/net-dns/getdns/getdns-1.4.1-r2.ebuild
index db4a0afb74a6..bff5d734d08e 100644
--- a/net-dns/getdns/getdns-1.4.1-r1.ebuild
+++ b/net-dns/getdns/getdns-1.4.1-r2.ebuild
@@ -50,8 +50,10 @@ src_configure() {
src_install() {
default
if use stubby; then
- newinitd "${FILESDIR}"/stubby.initd stubby
- newconfd "${FILESDIR}"/stubby.confd stubby
+ newinitd "${FILESDIR}"/stubby.initd-r1 stubby
+ newconfd "${FILESDIR}"/stubby.confd-r1 stubby
+ insinto /etc/logrotate.d
+ newins "${FILESDIR}"/stubby.logrotate stubby
systemd_newunit "${FILESDIR}"/stubby.systemd stubby.service
systemd_newtmpfilesd "${FILESDIR}"/stubby.tmpfilesd stubby.conf
fi