From 54db0fef68b5dbc5c304bdc2ca7b1440291ca66c Mon Sep 17 00:00:00 2001 From: Quentin Retornaz Date: Fri, 27 Apr 2018 22:28:49 +0200 Subject: net-dns/getdns: improved stubby initd/confd for logs and logrotate --- net-dns/getdns/files/stubby.confd | 4 -- net-dns/getdns/files/stubby.confd-r1 | 16 ++++++++ net-dns/getdns/files/stubby.initd | 21 ---------- net-dns/getdns/files/stubby.initd-r1 | 23 +++++++++++ net-dns/getdns/files/stubby.logrotate | 7 ++++ net-dns/getdns/getdns-1.4.1-r1.ebuild | 73 ---------------------------------- net-dns/getdns/getdns-1.4.1-r2.ebuild | 75 +++++++++++++++++++++++++++++++++++ 7 files changed, 121 insertions(+), 98 deletions(-) delete mode 100644 net-dns/getdns/files/stubby.confd create mode 100644 net-dns/getdns/files/stubby.confd-r1 delete mode 100755 net-dns/getdns/files/stubby.initd create mode 100755 net-dns/getdns/files/stubby.initd-r1 create mode 100644 net-dns/getdns/files/stubby.logrotate delete mode 100644 net-dns/getdns/getdns-1.4.1-r1.ebuild create mode 100644 net-dns/getdns/getdns-1.4.1-r2.ebuild (limited to 'net-dns/getdns') 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 deleted file mode 100755 index 170db9be07fe..000000000000 --- a/net-dns/getdns/files/stubby.initd +++ /dev/null @@ -1,21 +0,0 @@ -#!/sbin/openrc-run -# Copyright 1999-2018 Gentoo Foundation -# Distributed under the terms of the GNU General Public License, v2 or later - -command="capsh" -command_args="--inh=cap_net_bind_service --user=stubby -- -c '/usr/bin/stubby -g ${STUBBY_OPTS}'" -pidfile="/var/run/stubby/stubby.pid" -name="DNS Privacy Daemon" - -depend() -{ - provide dns - need localmount net - after bootmisc - use logger -} - -start_pre() -{ - checkpath -d -m 1755 -o stubby:stubby /var/run/stubby -} diff --git a/net-dns/getdns/files/stubby.initd-r1 b/net-dns/getdns/files/stubby.initd-r1 new file mode 100755 index 000000000000..e6b799919e28 --- /dev/null +++ b/net-dns/getdns/files/stubby.initd-r1 @@ -0,0 +1,23 @@ +#!/sbin/openrc-run +# 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} >>/var/log/stubby.log 2>&1'" +pidfile="/var/run/stubby/stubby.pid" +name="DNS Privacy Daemon" + +depend() +{ + provide dns + need localmount net + after bootmisc + use logger +} + +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-r1.ebuild deleted file mode 100644 index db4a0afb74a6..000000000000 --- a/net-dns/getdns/getdns-1.4.1-r1.ebuild +++ /dev/null @@ -1,73 +0,0 @@ -# Copyright 1999-2018 Gentoo Foundation -# Distributed under the terms of the GNU General Public License v2 - -EAPI=6 - -inherit user fcaps systemd - -DESCRIPTION="Modern asynchronous DNS API" -HOMEPAGE="https://getdnsapi.net/" -SRC_URI="https://getdnsapi.net/releases/${P//./-}/${P}.tar.gz" - -LICENSE="BSD" -SLOT="0" -KEYWORDS="~amd64 ~x86" -IUSE="stubby +getdns_query +getdns_server_mon libressl +idn +unbound libevent libev libuv +threads static-libs" - -DEPEND=" - dev-libs/libbsd:= - dev-libs/libyaml:= - !libressl? ( dev-libs/openssl:0= ) - libressl? ( dev-libs/libressl:0= ) - idn? ( net-dns/libidn2:= ) - unbound? ( >=net-dns/unbound-1.4.16:= ) - libevent? ( dev-libs/libevent:= ) - libev? ( dev-libs/libev:= ) - libuv? ( dev-libs/libuv:= ) -" -RDEPEND=" - ${DEPEND} - stubby? ( sys-libs/libcap:= ) -" - -src_configure() { - econf \ - --runstatedir=/var/run \ - --with-piddir=/var/run/stubby \ - $(use_with stubby) \ - $(use_with getdns_query) \ - $(use_with getdns_server_mon) \ - $(use_with idn libidn2) \ - --without-libidn \ - $(use_with unbound libunbound) \ - $(use_with libevent) \ - $(use_with libev) \ - $(use_with libuv) \ - $(use_with threads libpthread) - $(use_enable static-libs static) -} - -src_install() { - default - 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 -} - -pkg_postinst() { - if use stubby; then - enewgroup stubby - enewuser stubby -1 -1 -1 stubby - fcaps cap_net_bind_service=ei /usr/bin/stubby - fi - - if has_version