15.11.2025 13:41, [email protected] пишет:
>> Can you test what I sent and report whether it works for you?
> Looks great except $daemon-anchor just needs -a $_anchor instead of $_config.
Thanks, now I also tested everything wrt. unbound myself after the two
typofixes.
Feedback? OK?
Index: unbound
===================================================================
RCS file: /cvs/src/etc/rc.d/unbound,v
diff -u -p -r1.9 unbound
--- unbound 9 Oct 2024 15:42:56 -0000 1.9
+++ unbound 16 Nov 2025 04:20:11 -0000
@@ -3,18 +3,23 @@
# $OpenBSD: unbound,v 1.9 2024/10/09 15:42:56 kn Exp $
daemon="/usr/sbin/unbound"
-daemon_flags="-c /var/unbound/etc/unbound.conf"
. /etc/rc.d/rc.subr
rc_pre() {
- local _anchor=$(/usr/sbin/unbound-checkconf -o auto-trust-anchor-file)
+ local _anchor _config _opt
+
+ while getopts :c: _opt $daemon_flags; do
+ [[ $_opt == c ]] && _config=$OPTARG
+ done
+
+ _anchor=$($daemon-checkconf -o auto-trust-anchor-file $_config)
if [[ -n $_anchor && ! -f $_anchor ]]; then
- /usr/sbin/unbound-anchor -v
+ $daemon-anchor -v -a $_anchor
fi
- /usr/sbin/unbound-checkconf
+ $daemon-checkconf $_config
}
rc_cmd $1
Index: spamlogd
===================================================================
RCS file: /cvs/src/etc/rc.d/spamlogd,v
diff -u -p -r1.6 spamlogd
--- spamlogd 21 Apr 2022 09:31:28 -0000 1.6
+++ spamlogd 14 Nov 2025 15:48:39 -0000
@@ -9,8 +9,11 @@ daemon="/usr/libexec/spamlogd"
rc_reload=NO
rc_pre() {
- pflog=$(echo $daemon_flags | sed -En 's/.*-l *(pflog[0-9]+).*/\1/p')
- pflog=${pflog:-pflog0}
+ local _opt pflog=pflog0
+
+ while getopts :l: _opt $daemon_flags; do
+ [[ $_opt == l ]] && pflog=$OPTARG
+ done
if pfctl -si | grep -q Enabled; then
ifconfig $pflog create