Fri Oct 16 09:28:15 2020 UTC ()
For DNS Flag Day 2020, suggest enabling axfrdns along with tinydns. Let
the admin set axfrdns_ip distinctly from tinydns_ip, keeping the same
default. Fix an outdated comment. Bump version.


(schmonz)
diff -r1.36 -r1.37 pkgsrc/net/djbdns-run/Makefile
diff -r1.5 -r1.6 pkgsrc/net/djbdns-run/files/README.pkgsrc
diff -r1.10 -r1.11 pkgsrc/net/djbdns-run/files/axfrdns.sh

cvs diff -r1.36 -r1.37 pkgsrc/net/djbdns-run/Makefile (expand / switch to unified diff)

--- pkgsrc/net/djbdns-run/Makefile 2020/10/05 12:17:47 1.36
+++ pkgsrc/net/djbdns-run/Makefile 2020/10/16 09:28:14 1.37
@@ -1,17 +1,17 @@ @@ -1,17 +1,17 @@
1# $NetBSD: Makefile,v 1.36 2020/10/05 12:17:47 schmonz Exp $ 1# $NetBSD: Makefile,v 1.37 2020/10/16 09:28:14 schmonz Exp $
2# 2#
3 3
4DISTNAME= djbdns-run-20201005 4DISTNAME= djbdns-run-20201016
5CATEGORIES= net 5CATEGORIES= net
6MASTER_SITES= # empty 6MASTER_SITES= # empty
7DISTFILES= # empty 7DISTFILES= # empty
8 8
9MAINTAINER= schmonz@NetBSD.org 9MAINTAINER= schmonz@NetBSD.org
10COMMENT= Configures djbdns to cache and serve queries 10COMMENT= Configures djbdns to cache and serve queries
11LICENSE= 2-clause-bsd 11LICENSE= 2-clause-bsd
12 12
13DEPENDS+= ${DEPENDS_DJBDNS} 13DEPENDS+= ${DEPENDS_DJBDNS}
14DEPENDS+= daemontools-[0-9]*:../../sysutils/daemontools 14DEPENDS+= daemontools-[0-9]*:../../sysutils/daemontools
15 15
16WRKSRC= ${WRKDIR} 16WRKSRC= ${WRKDIR}
17NO_BUILD= yes 17NO_BUILD= yes

cvs diff -r1.5 -r1.6 pkgsrc/net/djbdns-run/files/README.pkgsrc (expand / switch to unified diff)

--- pkgsrc/net/djbdns-run/files/README.pkgsrc 2019/01/07 14:01:55 1.5
+++ pkgsrc/net/djbdns-run/files/README.pkgsrc 2020/10/16 09:28:14 1.6
@@ -1,29 +1,28 @@ @@ -1,29 +1,28 @@
1 Getting started 1 Getting started
2 =============== 2 ===============
3 3
4Assuming NetBSD-style rc(8), to enable a DNS... 4Assuming NetBSD-style rc(8), to enable a DNS...
5 5
6Caching resolver for the local machine: 6Caching resolver for the local machine:
7- Run "echo nameserver 127.0.0.1 > /etc/resolv.conf". 7- Run "echo nameserver 127.0.0.1 > /etc/resolv.conf".
8- Set dnscache=YES in /etc/rc.conf. 8- Set dnscache=YES in /etc/rc.conf.
9- Run "@RCD_SCRIPTS_DIR@/dnscache start". 9- Run "@RCD_SCRIPTS_DIR@/dnscache start".
10 10
11Authoritative name server: 11Authoritative name server:
12- Set tinydns=YES in /etc/rc.conf. 12- Set tinydns=YES axfrdns=YES in /etc/rc.conf.
13- Create @PKG_SYSCONFDIR@/tinydns/data with suitable contents. 13- Create @PKG_SYSCONFDIR@/tinydns/data with suitable contents.
14- Run "@RCD_SCRIPTS_DIR@/tinydns start". 14- Run "@RCD_SCRIPTS_DIR@/tinydns start".
15- For TCP service (if needed), set axfrdns=YES in /etc/rc.conf 15 and "@RCD_SCRIPTS_DIR@/axfrdns start".
16 and run "@RCD_SCRIPTS_DIR@/axfrdns start". 
17 16
18RBL name server: 17RBL name server:
19- Set rbldns=YES in /etc/rc.conf (and rbldns_ip to a suitable IP address). 18- Set rbldns=YES in /etc/rc.conf (and rbldns_ip to a suitable IP address).
20- Create @PKG_SYSCONFDIR@/rbldns/data with suitable contents. 19- Create @PKG_SYSCONFDIR@/rbldns/data with suitable contents.
21- Run "@RCD_SCRIPTS_DIR@/rbldns start". 20- Run "@RCD_SCRIPTS_DIR@/rbldns start".
22 21
23 22
24 Getting help 23 Getting help
25 ============ 24 ============
26 25
27You've installed an automated and customized djbdns-run package. 26You've installed an automated and customized djbdns-run package.
28If you're having trouble getting the djbdns daemons to run, ask 27If you're having trouble getting the djbdns daemons to run, ask
29the package's maintainer: 28the package's maintainer:

cvs diff -r1.10 -r1.11 pkgsrc/net/djbdns-run/files/axfrdns.sh (expand / switch to unified diff)

--- pkgsrc/net/djbdns-run/files/axfrdns.sh 2019/01/07 14:01:55 1.10
+++ pkgsrc/net/djbdns-run/files/axfrdns.sh 2020/10/16 09:28:15 1.11
@@ -1,29 +1,29 @@ @@ -1,29 +1,29 @@
1#!@RCD_SCRIPTS_SHELL@ 1#!@RCD_SCRIPTS_SHELL@
2# 2#
3# $NetBSD: axfrdns.sh,v 1.10 2019/01/07 14:01:55 schmonz Exp $ 3# $NetBSD: axfrdns.sh,v 1.11 2020/10/16 09:28:15 schmonz Exp $
4# 4#
5# @PKGNAME@ script to control axfrdns (DNS zone-transfer and TCP service). 5# @PKGNAME@ script to control axfrdns (DNS zone-transfer and TCP service).
6# 6#
7 7
8# PROVIDE: axfrdns named 8# PROVIDE: axfrdns named
9# REQUIRE: NETWORKING mountcritremote syslogd tinydns 9# REQUIRE: NETWORKING mountcritremote syslogd tinydns
10# BEFORE: DAEMON 10# BEFORE: DAEMON
11 11
12name="axfrdns" 12name="axfrdns"
13 13
14# User-settable rc.conf variables and their default values: 14# User-settable rc.conf variables and their default values:
15: ${axfrdns_postenv:=""} 15: ${axfrdns_postenv:=""}
16: ${tinydns_ip:="@TINYDNS_LISTENIP@"} 16: ${axfrdns_ip:="@TINYDNS_LISTENIP@"}
17: ${axfrdns_datalimit:="300000"} 17: ${axfrdns_datalimit:="300000"}
18: ${axfrdns_pretcpserver:=""} 18: ${axfrdns_pretcpserver:=""}
19: ${axfrdns_tcpserver:="@PREFIX@/bin/tcpserver"} 19: ${axfrdns_tcpserver:="@PREFIX@/bin/tcpserver"}
20: ${axfrdns_tcpflags:="-vDRHl0"} 20: ${axfrdns_tcpflags:="-vDRHl0"}
21: ${axfrdns_tcprules:="@PKG_SYSCONFDIR@/axfrdns/tcp"} 21: ${axfrdns_tcprules:="@PKG_SYSCONFDIR@/axfrdns/tcp"}
22: ${axfrdns_autocdb:="YES"} 22: ${axfrdns_autocdb:="YES"}
23: ${axfrdns_tcpport:="53"} 23: ${axfrdns_tcpport:="53"}
24: ${axfrdns_log:="YES"} 24: ${axfrdns_log:="YES"}
25: ${axfrdns_logcmd:="logger -t nbdjbdns/axfr -p daemon.info"} 25: ${axfrdns_logcmd:="logger -t nbdjbdns/axfr -p daemon.info"}
26: ${axfrdns_nologcmd:="@PREFIX@/bin/multilog -*"} 26: ${axfrdns_nologcmd:="@PREFIX@/bin/multilog -*"}
27 27
28if [ -f /etc/rc.subr ]; then 28if [ -f /etc/rc.subr ]; then
29 . /etc/rc.subr 29 . /etc/rc.subr
@@ -37,36 +37,36 @@ start_precmd="axfrdns_precmd" @@ -37,36 +37,36 @@ start_precmd="axfrdns_precmd"
37extra_commands="cdb reload" 37extra_commands="cdb reload"
38cdb_cmd="axfrdns_cdb" 38cdb_cmd="axfrdns_cdb"
39reload_cmd=${cdb_cmd} 39reload_cmd=${cdb_cmd}
40 40
41axfrdns_precmd() { 41axfrdns_precmd() {
42 if [ -f /etc/rc.subr ] && ! checkyesno axfrdns_log; then 42 if [ -f /etc/rc.subr ] && ! checkyesno axfrdns_log; then
43 axfrdns_logcmd=${axfrdns_nologcmd} 43 axfrdns_logcmd=${axfrdns_nologcmd}
44 fi 44 fi
45 if [ -f /etc/rc.subr ] && checkyesno axfrdns_autocdb; then 45 if [ -f /etc/rc.subr ] && checkyesno axfrdns_autocdb; then
46 axfrdns_needcdb && axfrdns_cdb 46 axfrdns_needcdb && axfrdns_cdb
47 fi 47 fi
48 # tcpserver(1) is akin to inetd(8), but runs one service per process. 48 # tcpserver(1) is akin to inetd(8), but runs one service per process.
49 # We want to signal only the tcpserver process responsible for this 49 # We want to signal only the tcpserver process responsible for this
50 # service. Use argv0(1) to set procname to "axfrdns". 50 # service. Use argv0(1) to set procname to "nbaxfrdns".
51 command="@PREFIX@/bin/pgrphack @SETENV@ - ${axfrdns_postenv} \ 51 command="@PREFIX@/bin/pgrphack @SETENV@ - ${axfrdns_postenv} \
52ROOT=@PKG_SYSCONFDIR@/tinydns \ 52ROOT=@PKG_SYSCONFDIR@/tinydns \
53IP=${tinydns_ip} \ 53IP=${axfrdns_ip} \
54@PREFIX@/bin/envuidgid @DJBDNS_AXFR_USER@ \ 54@PREFIX@/bin/envuidgid @DJBDNS_AXFR_USER@ \
55@PREFIX@/bin/softlimit -d ${axfrdns_datalimit} ${axfrdns_pretcpserver} \ 55@PREFIX@/bin/softlimit -d ${axfrdns_datalimit} ${axfrdns_pretcpserver} \
56@PREFIX@/bin/argv0 ${axfrdns_tcpserver} ${procname} \ 56@PREFIX@/bin/argv0 ${axfrdns_tcpserver} ${procname} \
57${axfrdns_tcpflags} -x ${axfrdns_tcprules}.cdb \ 57${axfrdns_tcpflags} -x ${axfrdns_tcprules}.cdb \
58-- \ 58-- \
59${tinydns_ip} ${axfrdns_tcpport} \ 59${axfrdns_ip} ${axfrdns_tcpport} \
60@PREFIX@/bin/${name} \ 60@PREFIX@/bin/${name} \
61</dev/null 2>&1 | \ 61</dev/null 2>&1 | \
62@PREFIX@/bin/pgrphack @PREFIX@/bin/setuidgid @DJBDNS_LOG_USER@ ${axfrdns_logcmd}" 62@PREFIX@/bin/pgrphack @PREFIX@/bin/setuidgid @DJBDNS_LOG_USER@ ${axfrdns_logcmd}"
63 command_args="&" 63 command_args="&"
64 rc_flags="" 64 rc_flags=""
65} 65}
66 66
67axfrdns_needcdb() { 67axfrdns_needcdb() {
68 _src=${axfrdns_tcprules} 68 _src=${axfrdns_tcprules}
69 _dst=${axfrdns_tcprules}.cdb 69 _dst=${axfrdns_tcprules}.cdb
70 [ -f "${_src}" -a "${_src}" -nt "${_dst}" ] || [ ! -f "${_dst}" ] 70 [ -f "${_src}" -a "${_src}" -nt "${_dst}" ] || [ ! -f "${_dst}" ]
71} 71}
72 72