Github messages for voidlinux
 help / color / mirror / Atom feed
From: MeganerdNL <MeganerdNL@users.noreply.github.com>
To: ml@inbox.vuxu.org
Subject: Re: [PR PATCH] [Updated] knot-resolver: fix configfile location in runit service
Date: Tue, 25 Jul 2023 22:55:54 +0200	[thread overview]
Message-ID: <20230725205554.GZPUiKuZQ3G7M47z7wW96mRTsPuIdyQvMYhN10KNwUc@z> (raw)
In-Reply-To: <gh-mailinglist-notifications-41a7ca26-5023-4802-975b-f1789d68868e-void-packages-45209@inbox.vuxu.org>

[-- Attachment #1: Type: text/plain, Size: 1151 bytes --]

There is an updated pull request by MeganerdNL against master on the void-packages repository

https://github.com/MeganerdNL/void-packages knot-resolver-update
https://github.com/void-linux/void-packages/pull/45209

knot-resolver: fix configfile location in runit service
#### Testing the changes
- I tested the changes in this PR: **YES**

## First
In the default installation the default config file (/etc/knot-resolver/kresd.conf)  is not read: so making changes to it, did nothing.

Per https://github.com/void-linux/void-packages/blob/master/Manual.md#writing_runit_services
you _could_ change CLI flags in **conf** file in the service directory, but I think this option should be enabled by default because the file /etc/knot-resolver/kresd.conf is also installed and otherwise it's confusing.

## Second
change: in default CLI variable:

```
-f 1 
```
to
 ```
--noninteractive
```
because _-f 1_ will be deprecated per warning on command line.

## Third
knot-resolver comes with a garbage collector. I added a service file for it.

A patch file from https://github.com/void-linux/void-packages/pull/45209.patch is attached

[-- Warning: decoded text below may be mangled, UTF-8 assumed --]
[-- Attachment #2: github-pr-knot-resolver-update-45209.patch --]
[-- Type: text/x-diff, Size: 2842 bytes --]

From 54b02159ccecaf69645a9b50d5040d3af9596023 Mon Sep 17 00:00:00 2001
From: MeganerdNL <meganerd@meganerd.nl>
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         |  3 +--
 srcpkgs/knot-resolver/template                |  3 ++-
 3 files changed, 26 insertions(+), 3 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 <garbage_interval(millis)> -c <resolver_cache>
+#
+# 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 <resolver_cache>) 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..a88ce1ed59fe8
--- a/srcpkgs/knot-resolver/files/kresd/run
+++ b/srcpkgs/knot-resolver/files/kresd/run
@@ -1,5 +1,4 @@
 #!/bin/sh
-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() {

  parent reply	other threads:[~2023-07-25 20:55 UTC|newest]

Thread overview: 26+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2023-07-23 19:37 [PR PATCH] " MeganerdNL
2023-07-23 19:42 ` classabbyamp
2023-07-23 21:00 ` MeganerdNL
2023-07-23 21:07 ` [PR PATCH] [Updated] " MeganerdNL
2023-07-23 21:08 ` MeganerdNL
2023-07-23 21:09 ` MeganerdNL
2023-07-23 21:10 ` MeganerdNL
2023-07-23 21:10 ` MeganerdNL
2023-07-24 14:09 ` MeganerdNL
2023-07-25  6:19 ` [PR PATCH] [Updated] " MeganerdNL
2023-07-25  6:22 ` MeganerdNL
2023-07-25  6:30 ` classabbyamp
2023-07-25  7:08 ` [PR PATCH] [Updated] " MeganerdNL
2023-07-25  7:08 ` MeganerdNL
2023-07-25  7:08 ` MeganerdNL
2023-07-25 20:48 ` [PR PATCH] [Updated] " MeganerdNL
2023-07-25 20:50 ` MeganerdNL
2023-07-25 20:50 ` MeganerdNL
2023-07-25 20:55 ` MeganerdNL [this message]
2023-07-25 21:08 ` [PR PATCH] [Updated] knot-resolver: config fixes + add garbage collector service MeganerdNL
2023-07-25 21:14 ` Duncaen
2023-07-26  1:28 ` classabbyamp
2023-07-26  5:22 ` [PR PATCH] [Updated] " MeganerdNL
2023-07-26  5:25 ` MeganerdNL
2023-07-26  5:30 ` MeganerdNL
2023-07-28  4:42 ` [PR PATCH] [Merged]: " classabbyamp

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=20230725205554.GZPUiKuZQ3G7M47z7wW96mRTsPuIdyQvMYhN10KNwUc@z \
    --to=meganerdnl@users.noreply.github.com \
    --cc=ml@inbox.vuxu.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).