From 4da699938bf34fb2a8e601c406fd0ee01dc8c97d Mon Sep 17 00:00:00 2001 From: MeganerdNL Date: Sun, 23 Jul 2023 21:31:32 +0200 Subject: [PATCH] knot-resolver: config fixes + add garbage collector service --- srcpkgs/knot-resolver/files/kres-cache-gc/run | 23 +++++++++++++++++++ srcpkgs/knot-resolver/files/kresd/run | 2 +- srcpkgs/knot-resolver/template | 3 ++- 3 files changed, 26 insertions(+), 2 deletions(-) create mode 100755 srcpkgs/knot-resolver/files/kres-cache-gc/run mode change 100644 => 100755 srcpkgs/knot-resolver/files/kresd/run diff --git a/srcpkgs/knot-resolver/files/kres-cache-gc/run b/srcpkgs/knot-resolver/files/kres-cache-gc/run new file mode 100755 index 0000000000000..ba6f5b3a2dc9a --- /dev/null +++ b/srcpkgs/knot-resolver/files/kres-cache-gc/run @@ -0,0 +1,23 @@ +#!/bin/sh +exec 2>&1 +[ -r ./conf ] && . ./conf +install -d -m0755 -o _knot_resolver -g _knot_resolver /run/knot-resolver + +# Do not change this file, as it will be overwritten when updated. +# OPTS can optionally be changed in a file named 'conf' in this directory. +# +# It must at minimum contain the following 2 options for the service to run: +# -d -c +# +# A 'conf' file will override both options, so add them both, even if you only change one. +# +# For example: +# +# OPTS="-d 1000 -c /run/knot-resolver" +# +# NOTE: +# Resolver cache (-c ) defaults to the working directory and MUST ALSO be changed in the +# config file (default: /etc/knot-resolver/kresd.conf) via setting: cache.storage = 'lmdb:///your-dir' +# This directory MUST exist. See knot-resolver documentation for more info. + +exec kres-cache-gc ${OPTS:- -d 1000 -c /run/knot-resolver} diff --git a/srcpkgs/knot-resolver/files/kresd/run b/srcpkgs/knot-resolver/files/kresd/run old mode 100644 new mode 100755 index 43b80cda27f2c..c42e0849b8911 --- a/srcpkgs/knot-resolver/files/kresd/run +++ b/srcpkgs/knot-resolver/files/kresd/run @@ -2,4 +2,4 @@ exec 2>&1 [ -r ./conf ] && . ./conf install -d -m0755 -o _knot_resolver -g _knot_resolver /run/knot-resolver -exec kresd ${OPTS:--f 1} +exec kresd ${OPTS:- --noninteractive -c /etc/knot-resolver/kresd.conf /run/knot-resolver} diff --git a/srcpkgs/knot-resolver/template b/srcpkgs/knot-resolver/template index 25cefaf4ef395..527c4216854e8 100644 --- a/srcpkgs/knot-resolver/template +++ b/srcpkgs/knot-resolver/template @@ -1,7 +1,7 @@ # Template file for 'knot-resolver' pkgname=knot-resolver version=5.6.0 -revision=1 +revision=2 build_style=meson configure_args=" -Dclient=enabled @@ -36,6 +36,7 @@ post_install() { vinstall etc/root.hints 644 var/lib/knot-resolver vinstall etc/root.keys 644 var/lib/knot-resolver vsv kresd + vsv kres-cache-gc } knot-resolver-devel_package() {