Gentoo Archives: gentoo-commits

From: "Anthony G. Basile" <blueness@g.o>
To: gentoo-commits@l.g.o
Subject: [gentoo-commits] repo/gentoo:master commit in: net-dns/getdns/files/, net-dns/getdns/
Date: Sat, 28 Apr 2018 10:51:57
Message-Id: 1524912645.54db0fef68b5dbc5c304bdc2ca7b1440291ca66c.blueness@gentoo
1 commit: 54db0fef68b5dbc5c304bdc2ca7b1440291ca66c
2 Author: Quentin Retornaz <caseoffr <AT> outlook <DOT> com>
3 AuthorDate: Fri Apr 27 20:28:49 2018 +0000
4 Commit: Anthony G. Basile <blueness <AT> gentoo <DOT> org>
5 CommitDate: Sat Apr 28 10:50:45 2018 +0000
6 URL: https://gitweb.gentoo.org/repo/gentoo.git/commit/?id=54db0fef
7
8 net-dns/getdns: improved stubby initd/confd for logs and logrotate
9
10 net-dns/getdns/files/stubby.confd | 4 ----
11 net-dns/getdns/files/stubby.confd-r1 | 16 ++++++++++++++++
12 net-dns/getdns/files/{stubby.initd => stubby.initd-r1} | 4 +++-
13 net-dns/getdns/files/stubby.logrotate | 7 +++++++
14 .../{getdns-1.4.1-r1.ebuild => getdns-1.4.1-r2.ebuild} | 6 ++++--
15 5 files changed, 30 insertions(+), 7 deletions(-)
16
17 diff --git a/net-dns/getdns/files/stubby.confd b/net-dns/getdns/files/stubby.confd
18 deleted file mode 100644
19 index b862ea4a40d..00000000000
20 --- a/net-dns/getdns/files/stubby.confd
21 +++ /dev/null
22 @@ -1,4 +0,0 @@
23 -# /etc/conf.d/stubby: config file for /etc/init.d/stubby
24 -
25 -# See stubby -h for possible options to put here.
26 -STUBBY_OPTS=""
27
28 diff --git a/net-dns/getdns/files/stubby.confd-r1 b/net-dns/getdns/files/stubby.confd-r1
29 new file mode 100644
30 index 00000000000..9c8d83f07f7
31 --- /dev/null
32 +++ b/net-dns/getdns/files/stubby.confd-r1
33 @@ -0,0 +1,16 @@
34 +# /etc/conf.d/stubby: config file for /etc/init.d/stubby
35 +
36 +# Enter here Stubby YAML configuration file to use.
37 +STUBBY_CONFIG_FILE="/etc/stubby/stubby.yml"
38 +
39 +# Set here Stubby log level to use.
40 +# Following log levels are available:
41 +# 0: EMERG - System is unusable
42 +# 1: ALERT - Action must be taken immediately
43 +# 2: CRIT - Critical conditions
44 +# 3: ERROR - Error conditions
45 +# 4: WARN - Warning conditions
46 +# 5: NOTICE - Normal, but significant, condition
47 +# 6: INFO - Informational message
48 +# 7: DEBUG - Debug-level message
49 +STUBBY_LOGLEVEL="5"
50
51 diff --git a/net-dns/getdns/files/stubby.initd b/net-dns/getdns/files/stubby.initd-r1
52 similarity index 67%
53 rename from net-dns/getdns/files/stubby.initd
54 rename to net-dns/getdns/files/stubby.initd-r1
55 index 170db9be07f..e6b799919e2 100755
56 --- a/net-dns/getdns/files/stubby.initd
57 +++ b/net-dns/getdns/files/stubby.initd-r1
58 @@ -2,8 +2,9 @@
59 # Copyright 1999-2018 Gentoo Foundation
60 # Distributed under the terms of the GNU General Public License, v2 or later
61
62 +stubby_opts="-C ${STUBBY_CONFIG_FILE:-/etc/stubby/stubby.yml} -v ${STUBBY_LOGLEVEL:-5}"
63 command="capsh"
64 -command_args="--inh=cap_net_bind_service --user=stubby -- -c '/usr/bin/stubby -g ${STUBBY_OPTS}'"
65 +command_args="--inh=cap_net_bind_service --user=stubby -- -c '/usr/bin/stubby -g ${stubby_opts} >>/var/log/stubby.log 2>&1'"
66 pidfile="/var/run/stubby/stubby.pid"
67 name="DNS Privacy Daemon"
68
69 @@ -18,4 +19,5 @@ depend()
70 start_pre()
71 {
72 checkpath -d -m 1755 -o stubby:stubby /var/run/stubby
73 + checkpath -f -m 0644 -o stubby:stubby /var/log/stubby.log
74 }
75
76 diff --git a/net-dns/getdns/files/stubby.logrotate b/net-dns/getdns/files/stubby.logrotate
77 new file mode 100644
78 index 00000000000..48058782594
79 --- /dev/null
80 +++ b/net-dns/getdns/files/stubby.logrotate
81 @@ -0,0 +1,7 @@
82 +/var/log/stubby.log {
83 + rotate 4
84 + compress
85 + size 200k
86 + noolddir
87 + missingok
88 +}
89
90 diff --git a/net-dns/getdns/getdns-1.4.1-r1.ebuild b/net-dns/getdns/getdns-1.4.1-r2.ebuild
91 similarity index 91%
92 rename from net-dns/getdns/getdns-1.4.1-r1.ebuild
93 rename to net-dns/getdns/getdns-1.4.1-r2.ebuild
94 index db4a0afb74a..bff5d734d08 100644
95 --- a/net-dns/getdns/getdns-1.4.1-r1.ebuild
96 +++ b/net-dns/getdns/getdns-1.4.1-r2.ebuild
97 @@ -50,8 +50,10 @@ src_configure() {
98 src_install() {
99 default
100 if use stubby; then
101 - newinitd "${FILESDIR}"/stubby.initd stubby
102 - newconfd "${FILESDIR}"/stubby.confd stubby
103 + newinitd "${FILESDIR}"/stubby.initd-r1 stubby
104 + newconfd "${FILESDIR}"/stubby.confd-r1 stubby
105 + insinto /etc/logrotate.d
106 + newins "${FILESDIR}"/stubby.logrotate stubby
107 systemd_newunit "${FILESDIR}"/stubby.systemd stubby.service
108 systemd_newtmpfilesd "${FILESDIR}"/stubby.tmpfilesd stubby.conf
109 fi