pkgsrc-Changes archive

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index][Old Index]

CVS commit: pkgsrc/net/djbdns-run



Module Name:    pkgsrc
Committed By:   schmonz
Date:           Mon Jan  7 14:01:56 UTC 2019

Modified Files:
        pkgsrc/net/djbdns-run: DESCR MESSAGE Makefile PLIST options.mk
        pkgsrc/net/djbdns-run/files: README.pkgsrc axfrdns.sh djbdns.sh
            dnscache.sh rbldns.sh tinydns.sh
Added Files:
        pkgsrc/net/djbdns-run/files: axfrdns-tcp dnscache-ip
Removed Files:
        pkgsrc/net/djbdns-run: INSTALL

Log Message:
With the 'inet6' option, depend on djbdnscurve6 instead of djbdns.

Extract most of MESSAGE to README.pkgsrc.

Remove vestigial Red Hat chkconfig stanza from main control script (we
have pkgtools/rc.d-boot now).

Use CONF_FILES where applicable.

rc.d script defaults:
- Tag log entries like qmail-run's; for instance, "nbtinydns" and
  "nbdnscache" become "nbdjbdns/tiny" and "nbdjbdns/cache".
- Have tinydns listen on the network.
- Auto-rebuild CDBs as needed on service start.

Bump version.


To generate a diff of this commit:
cvs rdiff -u -r1.3 -r1.4 pkgsrc/net/djbdns-run/DESCR
cvs rdiff -u -r1.3 -r0 pkgsrc/net/djbdns-run/INSTALL
cvs rdiff -u -r1.2 -r1.3 pkgsrc/net/djbdns-run/MESSAGE
cvs rdiff -u -r1.30 -r1.31 pkgsrc/net/djbdns-run/Makefile
cvs rdiff -u -r1.6 -r1.7 pkgsrc/net/djbdns-run/PLIST
cvs rdiff -u -r1.1 -r1.2 pkgsrc/net/djbdns-run/options.mk
cvs rdiff -u -r1.4 -r1.5 pkgsrc/net/djbdns-run/files/README.pkgsrc
cvs rdiff -u -r0 -r1.1 pkgsrc/net/djbdns-run/files/axfrdns-tcp \
    pkgsrc/net/djbdns-run/files/dnscache-ip
cvs rdiff -u -r1.9 -r1.10 pkgsrc/net/djbdns-run/files/axfrdns.sh \
    pkgsrc/net/djbdns-run/files/tinydns.sh
cvs rdiff -u -r1.2 -r1.3 pkgsrc/net/djbdns-run/files/djbdns.sh
cvs rdiff -u -r1.10 -r1.11 pkgsrc/net/djbdns-run/files/dnscache.sh
cvs rdiff -u -r1.7 -r1.8 pkgsrc/net/djbdns-run/files/rbldns.sh

Please note that diffs are not public domain; they are subject to the
copyright notices on the relevant files.

Modified files:

Index: pkgsrc/net/djbdns-run/DESCR
diff -u pkgsrc/net/djbdns-run/DESCR:1.3 pkgsrc/net/djbdns-run/DESCR:1.4
--- pkgsrc/net/djbdns-run/DESCR:1.3     Wed Dec 29 16:35:41 2004
+++ pkgsrc/net/djbdns-run/DESCR Mon Jan  7 14:01:55 2019
@@ -1,2 +1,2 @@
-This package creates all the needed basic config files to run djbdns
-services, and provides NetBSD-style rc.d scripts.
+This package creates the config files and NetBSD-style rc.d scripts
+needed to run djbdns or djbdnscurve6.

Index: pkgsrc/net/djbdns-run/MESSAGE
diff -u pkgsrc/net/djbdns-run/MESSAGE:1.2 pkgsrc/net/djbdns-run/MESSAGE:1.3
--- pkgsrc/net/djbdns-run/MESSAGE:1.2   Wed Jan 26 07:01:10 2005
+++ pkgsrc/net/djbdns-run/MESSAGE       Mon Jan  7 14:01:55 2019
@@ -1,26 +1,13 @@
 ===========================================================================
-$NetBSD: MESSAGE,v 1.2 2005/01/26 07:01:10 schmonz Exp $
+$NetBSD: MESSAGE,v 1.3 2019/01/07 14:01:55 schmonz Exp $
 
-Please read ${PREFIX}/share/doc/djbdns-run/README.pkgsrc.
+Assuming NetBSD-style rc(8), to enable a local DNS caching resolver:
 
-To enable a DNS...
-
-Cache for the local machine:
-- Set dnscache=YES in /etc/rc.conf.
 - Run "echo nameserver 127.0.0.1 > /etc/resolv.conf".
+- Set dnscache=YES in /etc/rc.conf.
+- Run "${RCD_SCRIPTS_DIR}/dnscache start".
 
-UDP name service:
-- Set tinydns=YES in /etc/rc.conf and tinydns_ip to a suitable IP address.
-- Create ${PKG_SYSCONFDIR}/tinydns/data with suitable contents.
-- Run "${RCD_SCRIPTS_DIR}/tinydns cdb".
-
-TCP name service:
-- Enable UDP name service.
-- Set axfrdns=YES in /etc/rc.conf.
-
-RBL name service:
-- Set rbldns=YES in /etc/rc.conf and rbldns_ip to a suitable IP address.
-- Create ${PKG_SYSCONFDIR}/rbldns/data with suitable contents.
-- Run "${RCD_SCRIPTS_DIR}/rbldns cdb".
+For authoritative name service, RBL service, and more, please read
+${PREFIX}/share/doc/djbdns-run/README.pkgsrc.
 
 ===========================================================================

Index: pkgsrc/net/djbdns-run/Makefile
diff -u pkgsrc/net/djbdns-run/Makefile:1.30 pkgsrc/net/djbdns-run/Makefile:1.31
--- pkgsrc/net/djbdns-run/Makefile:1.30 Sun Jul 29 23:59:26 2018
+++ pkgsrc/net/djbdns-run/Makefile      Mon Jan  7 14:01:55 2019
@@ -1,7 +1,7 @@
-# $NetBSD: Makefile,v 1.30 2018/07/29 23:59:26 schmonz Exp $
+# $NetBSD: Makefile,v 1.31 2019/01/07 14:01:55 schmonz Exp $
 #
 
-DISTNAME=              djbdns-run-20180730
+DISTNAME=              djbdns-run-20190107
 CATEGORIES=            net
 MASTER_SITES=          # empty
 DISTFILES=             # empty
@@ -10,7 +10,6 @@ MAINTAINER=           schmonz%NetBSD.org@localhost
 COMMENT=               Configures djbdns to cache and serve queries
 LICENSE=               2-clause-bsd
 
-DEPENDS_DJBDNS=                djbdns>=1.05nb5:../../net/djbdns
 DEPENDS+=              ${DEPENDS_DJBDNS}
 DEPENDS+=              daemontools-[0-9]*:../../sysutils/daemontools
 
@@ -37,11 +36,18 @@ FILES_SUBST+=               DJBDNS_RBL_USER=${DJBDNS_
 FILES_SUBST+=          DJBDNS_TINY_USER=${DJBDNS_TINY_USER:Q}
 FILES_SUBST+=          PKGNAME=${PKGNAME:Q}
 
-INSTALLATION_DIRS=     share/doc/djbdns-run
+INSTALLATION_DIRS=     share/doc/djbdns-run share/examples/djbdns-run
 BUILD_DEFS+=           DJBDNS_AXFR_USER DJBDNS_CACHE_USER DJBDNS_LOG_USER
 BUILD_DEFS+=           DJBDNS_RBL_USER DJBDNS_TINY_USER
 BUILD_DEFS+=           DJBDNS_DJBDNS_GROUP
 
+CONF_FILES+=           ${PKG_SYSCONFDIR}/dnsroots.global \
+                       ${PKG_SYSCONFDIR}/dnscache/servers/@
+CONF_FILES+=           ${PREFIX}/share/examples/djbdns-run/axfrdns-tcp \
+                       ${PKG_SYSCONFDIR}/axfrdns/tcp
+
+.include "options.mk"
+
 .include "../../mk/bsd.prefs.mk"
 
 # Detect the PKG_SYSCONFDIR of the installed djbdns, so we can create
@@ -57,9 +63,9 @@ MAKEVARS+=    PKG_SYSCONFDIR.djbdns-run
 .  endif
 .endif
 
-.include "options.mk"
-
 do-install:
        ${INSTALL_DATA} ${FILESDIR}/README.pkgsrc ${DESTDIR}${PREFIX}/share/doc/djbdns-run
+       ${INSTALL_DATA} ${FILESDIR}/axfrdns-tcp ${DESTDIR}${PREFIX}/share/examples/djbdns-run
+       ${INSTALL_DATA} ${FILESDIR}/dnscache-ip ${DESTDIR}${PREFIX}/share/examples/djbdns-run
 
 .include "../../mk/bsd.pkg.mk"

Index: pkgsrc/net/djbdns-run/PLIST
diff -u pkgsrc/net/djbdns-run/PLIST:1.6 pkgsrc/net/djbdns-run/PLIST:1.7
--- pkgsrc/net/djbdns-run/PLIST:1.6     Tue Mar 11 14:05:07 2014
+++ pkgsrc/net/djbdns-run/PLIST Mon Jan  7 14:01:55 2019
@@ -1,2 +1,4 @@
-@comment $NetBSD: PLIST,v 1.6 2014/03/11 14:05:07 jperkin Exp $
+@comment $NetBSD: PLIST,v 1.7 2019/01/07 14:01:55 schmonz Exp $
 share/doc/djbdns-run/README.pkgsrc
+share/examples/djbdns-run/axfrdns-tcp
+share/examples/djbdns-run/dnscache-ip

Index: pkgsrc/net/djbdns-run/options.mk
diff -u pkgsrc/net/djbdns-run/options.mk:1.1 pkgsrc/net/djbdns-run/options.mk:1.2
--- pkgsrc/net/djbdns-run/options.mk:1.1        Sun Jul 29 23:59:26 2018
+++ pkgsrc/net/djbdns-run/options.mk    Mon Jan  7 14:01:55 2019
@@ -1,12 +1,28 @@
-# $NetBSD: options.mk,v 1.1 2018/07/29 23:59:26 schmonz Exp $
+# $NetBSD: options.mk,v 1.2 2019/01/07 14:01:55 schmonz Exp $
 
-PKG_OPTIONS_VAR=               PKG_OPTIONS.djbdns-run
-PKG_SUPPORTED_OPTIONS+=                inet6
+PKG_OPTIONS_VAR=       PKG_OPTIONS.djbdns-run
+PKG_SUPPORTED_OPTIONS+=        inet6
 
 .include "../../mk/bsd.options.mk"
 
+FILES_SUBST+=          TINYDNS_LISTENIP=${TINYDNS_LISTENIP:Q}
+FILES_SUBST+=          DNSCACHE_LISTENIP=${DNSCACHE_LISTENIP:Q}
+FILES_SUBST+=          DNSCACHE_SENDIP=${DNSCACHE_SENDIP:Q}
+
 .if !empty(PKG_OPTIONS:Minet6)
-DEPENDS+=                      ucspi-tcp6-[0-9]*:../../net/ucspi-tcp6
+DEPENDS_DJBDNS=                djbdnscurve6-[0-9]*:../../net/djbdnscurve6
+DEPENDS+=              ucspi-tcp6-[0-9]*:../../net/ucspi-tcp6
+TINYDNS_LISTENIP=      ::
+DNSCACHE_LISTENIP=     ::1
+DNSCACHE_SENDIP=       ::
+CONF_FILES+=           ${PREFIX}/share/examples/${PKGBASE}/dnscache-ip \
+                       ${PKG_SYSCONFDIR}/dnscache/ip/::1
 .else
-DEPENDS+=                      ucspi-tcp-[0-9]*:../../net/ucspi-tcp
+DEPENDS_DJBDNS=                djbdns>=1.05nb5:../../net/djbdns
+DEPENDS+=              ucspi-tcp-[0-9]*:../../net/ucspi-tcp
+TINYDNS_LISTENIP=      0.0.0.0
+DNSCACHE_LISTENIP=     127.0.0.1
+DNSCACHE_SENDIP=       0.0.0.0
+CONF_FILES+=           ${PREFIX}/share/examples/${PKGBASE}/dnscache-ip \
+                       ${PKG_SYSCONFDIR}/dnscache/ip/127.0.0.1
 .endif

Index: pkgsrc/net/djbdns-run/files/README.pkgsrc
diff -u pkgsrc/net/djbdns-run/files/README.pkgsrc:1.4 pkgsrc/net/djbdns-run/files/README.pkgsrc:1.5
--- pkgsrc/net/djbdns-run/files/README.pkgsrc:1.4       Wed Dec 29 16:35:41 2004
+++ pkgsrc/net/djbdns-run/files/README.pkgsrc   Mon Jan  7 14:01:55 2019
@@ -1,3 +1,26 @@
+ Getting started
+ ===============
+
+Assuming NetBSD-style rc(8), to enable a DNS...
+
+Caching resolver for the local machine:
+- Run "echo nameserver 127.0.0.1 > /etc/resolv.conf".
+- Set dnscache=YES in /etc/rc.conf.
+- Run "@RCD_SCRIPTS_DIR@/dnscache start".
+
+Authoritative name server:
+- Set tinydns=YES in /etc/rc.conf.
+- Create @PKG_SYSCONFDIR@/tinydns/data with suitable contents.
+- Run "@RCD_SCRIPTS_DIR@/tinydns start".
+- For TCP service (if needed), set axfrdns=YES in /etc/rc.conf
+  and run "@RCD_SCRIPTS_DIR@/axfrdns start".
+
+RBL name server:
+- Set rbldns=YES in /etc/rc.conf (and rbldns_ip to a suitable IP address).
+- Create @PKG_SYSCONFDIR@/rbldns/data with suitable contents.
+- Run "@RCD_SCRIPTS_DIR@/rbldns start".
+
+
  Getting help
  ============
 

Index: pkgsrc/net/djbdns-run/files/axfrdns.sh
diff -u pkgsrc/net/djbdns-run/files/axfrdns.sh:1.9 pkgsrc/net/djbdns-run/files/axfrdns.sh:1.10
--- pkgsrc/net/djbdns-run/files/axfrdns.sh:1.9  Sat Aug  5 15:16:05 2017
+++ pkgsrc/net/djbdns-run/files/axfrdns.sh      Mon Jan  7 14:01:55 2019
@@ -1,6 +1,6 @@
 #!@RCD_SCRIPTS_SHELL@
 #
-# $NetBSD: axfrdns.sh,v 1.9 2017/08/05 15:16:05 schmonz Exp $
+# $NetBSD: axfrdns.sh,v 1.10 2019/01/07 14:01:55 schmonz Exp $
 #
 # @PKGNAME@ script to control axfrdns (DNS zone-transfer and TCP service).
 #
@@ -13,13 +13,16 @@ name="axfrdns"
 
 # User-settable rc.conf variables and their default values:
 : ${axfrdns_postenv:=""}
-: ${axfrdns_tcpflags:="-vDRHl0"}
-: ${axfrdns_tcpport:="53"}
+: ${tinydns_ip:="@TINYDNS_LISTENIP@"}
 : ${axfrdns_datalimit:="300000"}
 : ${axfrdns_pretcpserver:=""}
 : ${axfrdns_tcpserver:="@PREFIX@/bin/tcpserver"}
+: ${axfrdns_tcpflags:="-vDRHl0"}
+: ${axfrdns_tcprules:="@PKG_SYSCONFDIR@/axfrdns/tcp"}
+: ${axfrdns_autocdb:="YES"}
+: ${axfrdns_tcpport:="53"}
 : ${axfrdns_log:="YES"}
-: ${axfrdns_logcmd:="logger -t nb${name} -p daemon.info"}
+: ${axfrdns_logcmd:="logger -t nbdjbdns/axfr -p daemon.info"}
 : ${axfrdns_nologcmd:="@PREFIX@/bin/multilog -*"}
 
 if [ -f /etc/rc.subr ]; then
@@ -27,7 +30,7 @@ if [ -f /etc/rc.subr ]; then
 fi
 
 rcvar=${name}
-required_files="@PKG_SYSCONFDIR@/${name}/tcp.cdb"
+required_files="${axfrdns_tcprules}"
 command="${axfrdns_tcpserver}"
 procname=nb${name}
 start_precmd="axfrdns_precmd"
@@ -35,34 +38,42 @@ extra_commands="cdb reload"
 cdb_cmd="axfrdns_cdb"
 reload_cmd=${cdb_cmd}
 
-axfrdns_precmd()
-{
+axfrdns_precmd() {
        if [ -f /etc/rc.subr ] && ! checkyesno axfrdns_log; then
                axfrdns_logcmd=${axfrdns_nologcmd}
        fi
+       if [ -f /etc/rc.subr ] && checkyesno axfrdns_autocdb; then
+               axfrdns_needcdb && axfrdns_cdb
+       fi
        # tcpserver(1) is akin to inetd(8), but runs one service per process.
        # We want to signal only the tcpserver process responsible for this
        # service. Use argv0(1) to set procname to "axfrdns".
-       command="@PREFIX@/bin/pgrphack @SETENV@ - ${axfrdns_postenv}
-ROOT=@PKG_SYSCONFDIR@/tinydns IP=${tinydns_ip}
-@PREFIX@/bin/envuidgid @DJBDNS_AXFR_USER@
-@PREFIX@/bin/softlimit -d ${axfrdns_datalimit} ${axfrdns_pretcpserver}
-@PREFIX@/bin/argv0 ${axfrdns_tcpserver} ${procname}
-${axfrdns_tcpflags} -x @PKG_SYSCONFDIR@/${name}/tcp.cdb
--- ${tinydns_ip} ${axfrdns_tcpport}
-@PREFIX@/bin/${name}
-</dev/null 2>&1 |
+       command="@PREFIX@/bin/pgrphack @SETENV@ - ${axfrdns_postenv} \
+ROOT=@PKG_SYSCONFDIR@/tinydns \
+IP=${tinydns_ip} \
+@PREFIX@/bin/envuidgid @DJBDNS_AXFR_USER@ \
+@PREFIX@/bin/softlimit -d ${axfrdns_datalimit} ${axfrdns_pretcpserver} \
+@PREFIX@/bin/argv0 ${axfrdns_tcpserver} ${procname} \
+${axfrdns_tcpflags} -x ${axfrdns_tcprules}.cdb \
+-- \
+${tinydns_ip} ${axfrdns_tcpport} \
+@PREFIX@/bin/${name} \
+</dev/null 2>&1 | \
 @PREFIX@/bin/pgrphack @PREFIX@/bin/setuidgid @DJBDNS_LOG_USER@ ${axfrdns_logcmd}"
        command_args="&"
        rc_flags=""
 }
 
-axfrdns_cdb()
-{
-       @ECHO@ "Reloading @PKG_SYSCONFDIR@/axfrdns/tcp."
-       cd @PKG_SYSCONFDIR@/${name}
-       @PREFIX@/bin/tcprules tcp.cdb tcp.tmp < tcp
-       @CHMOD@ 644 tcp.cdb
+axfrdns_needcdb() {
+       _src=${axfrdns_tcprules}
+       _dst=${axfrdns_tcprules}.cdb
+       [ -f "${_src}" -a "${_src}" -nt "${_dst}" ] || [ ! -f "${_dst}" ]
+}
+
+axfrdns_cdb() {
+       @ECHO@ "Reloading ${axfrdns_tcprules}."
+       @PREFIX@/bin/tcprules ${axfrdns_tcprules}.cdb ${axfrdns_tcprules}.tmp < ${axfrdns_tcprules}
+       @CHMOD@ 644 ${axfrdns_tcprules}.cdb
 }
 
 if [ -f /etc/rc.subr ]; then
Index: pkgsrc/net/djbdns-run/files/tinydns.sh
diff -u pkgsrc/net/djbdns-run/files/tinydns.sh:1.9 pkgsrc/net/djbdns-run/files/tinydns.sh:1.10
--- pkgsrc/net/djbdns-run/files/tinydns.sh:1.9  Sat Aug  5 15:16:05 2017
+++ pkgsrc/net/djbdns-run/files/tinydns.sh      Mon Jan  7 14:01:55 2019
@@ -1,6 +1,6 @@
 #!@RCD_SCRIPTS_SHELL@
 #
-# $NetBSD: tinydns.sh,v 1.9 2017/08/05 15:16:05 schmonz Exp $
+# $NetBSD: tinydns.sh,v 1.10 2019/01/07 14:01:55 schmonz Exp $
 #
 # @PKGNAME@ script to control tinydns (authoritative DNS service).
 #
@@ -13,18 +13,21 @@ name="tinydns"
 
 # User-settable rc.conf variables and their default values:
 : ${tinydns_postenv:=""}
-: ${tinydns_ip:="127.0.0.2"}
+: ${tinydns_ip:="@TINYDNS_LISTENIP@"}
 : ${tinydns_datalimit:="300000"}
+: ${tinydns_autocdb:="YES"}
 : ${tinydns_log:="YES"}
-: ${tinydns_logcmd:="logger -t nb${name} -p daemon.info"}
+: ${tinydns_logcmd:="logger -t nbdjbdns/tiny -p daemon.info"}
 : ${tinydns_nologcmd:="@PREFIX@/bin/multilog -*"}
 
+tinydns_data="@PKG_SYSCONFDIR@/${name}/data"
+
 if [ -f /etc/rc.subr ]; then
        . /etc/rc.subr
 fi
 
 rcvar=${name}
-required_files="@PKG_SYSCONFDIR@/${name}/data.cdb"
+required_files="${tinydns_data}"
 command="@PREFIX@/bin/${name}"
 procname=nb${name}
 start_precmd="tinydns_precmd"
@@ -32,28 +35,35 @@ extra_commands="cdb reload"
 cdb_cmd="tinydns_cdb"
 reload_cmd=${cdb_cmd}
 
-tinydns_precmd()
-{
+tinydns_precmd() {
        if [ -f /etc/rc.subr ] && ! checkyesno tinydns_log; then
                tinydns_logcmd=${tinydns_nologcmd}
        fi
-       command="@PREFIX@/bin/pgrphack @SETENV@ - ${tinydns_postenv}
-ROOT=@PKG_SYSCONFDIR@/${name} IP=${tinydns_ip}
-@PREFIX@/bin/envuidgid @DJBDNS_TINY_USER@
-@PREFIX@/bin/softlimit -d ${tinydns_datalimit}
-@PREFIX@/bin/argv0 @PREFIX@/bin/${name} ${procname}
-</dev/null 2>&1 |
+       if [ -f /etc/rc.subr ] && checkyesno tinydns_autocdb; then
+               tinydns_needcdb && tinydns_cdb
+       fi
+       command="@PREFIX@/bin/pgrphack @SETENV@ - ${tinydns_postenv} \
+ROOT=@PKG_SYSCONFDIR@/${name} \
+IP=${tinydns_ip} \
+@PREFIX@/bin/envuidgid @DJBDNS_TINY_USER@ \
+@PREFIX@/bin/softlimit -d ${tinydns_datalimit} \
+@PREFIX@/bin/argv0 @PREFIX@/bin/${name} ${procname} \
+</dev/null 2>&1 | \
 @PREFIX@/bin/pgrphack @PREFIX@/bin/setuidgid @DJBDNS_LOG_USER@ ${tinydns_logcmd}"
        command_args="&"
        rc_flags=""
 }
 
-tinydns_cdb()
-{
-       @ECHO@ "Reloading @PKG_SYSCONFDIR@/${name}/data."
-       cd @PKG_SYSCONFDIR@/${name}
-       @PREFIX@/bin/tinydns-data
-       @CHMOD@ 644 data.cdb
+tinydns_needcdb() {
+       _src=${tinydns_data}
+       _dst=${tinydns_data}.cdb
+       [ -f "${_src}" -a "${_src}" -nt "${_dst}" ] || [ ! -f "${_dst}" ]
+}
+
+tinydns_cdb() {
+       @ECHO@ "Reloading ${tinydns_data}."
+       cd @PKG_SYSCONFDIR@/${name} && @PREFIX@/bin/tinydns-data
+       @CHMOD@ 644 ${tinydns_data}.cdb
 }
 
 if [ -f /etc/rc.subr ]; then

Index: pkgsrc/net/djbdns-run/files/djbdns.sh
diff -u pkgsrc/net/djbdns-run/files/djbdns.sh:1.2 pkgsrc/net/djbdns-run/files/djbdns.sh:1.3
--- pkgsrc/net/djbdns-run/files/djbdns.sh:1.2   Sat Aug  5 15:16:05 2017
+++ pkgsrc/net/djbdns-run/files/djbdns.sh       Mon Jan  7 14:01:55 2019
@@ -1,14 +1,10 @@
 #!@RCD_SCRIPTS_SHELL@
 #
-# $NetBSD: djbdns.sh,v 1.2 2017/08/05 15:16:05 schmonz Exp $
+# $NetBSD: djbdns.sh,v 1.3 2019/01/07 14:01:55 schmonz Exp $
 #
 # @PKGNAME@ master script for administrators to control djbdns
 # services.
 #
-# For Red Hat chkconfig
-# chkconfig: - 55 45
-# description: DJB's collection of DNS tools
-#
 
 # KEYWORD: nostart
 
@@ -20,13 +16,11 @@ rcd_dir=`@DIRNAME@ $0`
 
 # NOTE: run_rc_command sets $rc_arg
 #
-forward_commands()
-{
+forward_commands() {
        djbdnsrcd $COMMAND_LIST
 }
 
-reverse_commands()
-{
+reverse_commands() {
        REVCOMMAND_LIST=
        for file in $COMMAND_LIST; do
                REVCOMMAND_LIST="$file $REVCOMMAND_LIST"
@@ -35,8 +29,7 @@ reverse_commands()
        djbdnsrcd $REVCOMMAND_LIST
 }
 
-djbdnsrcd()
-{
+djbdnsrcd() {
        # Backward compat with NetBSD <1.6:
        [ -z "$rc_arg" ] && rc_arg=$_arg
 

Index: pkgsrc/net/djbdns-run/files/dnscache.sh
diff -u pkgsrc/net/djbdns-run/files/dnscache.sh:1.10 pkgsrc/net/djbdns-run/files/dnscache.sh:1.11
--- pkgsrc/net/djbdns-run/files/dnscache.sh:1.10        Sat Aug  5 15:16:05 2017
+++ pkgsrc/net/djbdns-run/files/dnscache.sh     Mon Jan  7 14:01:55 2019
@@ -1,6 +1,6 @@
 #!@RCD_SCRIPTS_SHELL@
 #
-# $NetBSD: dnscache.sh,v 1.10 2017/08/05 15:16:05 schmonz Exp $
+# $NetBSD: dnscache.sh,v 1.11 2019/01/07 14:01:55 schmonz Exp $
 #
 # @PKGNAME@ script to control dnscache (caching DNS resolver).
 #
@@ -13,12 +13,12 @@ name="dnscache"
 
 # User-settable rc.conf variables and their default values:
 : ${dnscache_postenv:=""}
-: ${dnscache_ip:="127.0.0.1"}
-: ${dnscache_ipsend:="0.0.0.0"}
+: ${dnscache_ip:="@DNSCACHE_LISTENIP@"}
+: ${dnscache_ipsend:="@DNSCACHE_SENDIP@"}
 : ${dnscache_size:="1000000"}
 : ${dnscache_datalimit:="3000000"}
 : ${dnscache_log:="YES"}
-: ${dnscache_logcmd:="logger -t nb${name} -p daemon.info"}
+: ${dnscache_logcmd:="logger -t nbdjbdns/cache -p daemon.info"}
 : ${dnscache_nologcmd:="@PREFIX@/bin/multilog -*"}
 
 if [ -f /etc/rc.subr ]; then
@@ -32,18 +32,19 @@ command="@PREFIX@/bin/${name}"
 procname=nb${name}
 start_precmd="dnscache_precmd"
 
-dnscache_precmd()
-{
+dnscache_precmd() {
        if [ -f /etc/rc.subr ] && ! checkyesno dnscache_log; then
                dnscache_logcmd=${dnscache_nologcmd}
        fi
-       command="@PREFIX@/bin/pgrphack @SETENV@ - ${dnscache_postenv}
-ROOT=@PKG_SYSCONFDIR@/${name} IP=${dnscache_ip}
-IPSEND=${dnscache_ipsend} CACHESIZE=${dnscache_size}
-@PREFIX@/bin/envuidgid @DJBDNS_CACHE_USER@
-@PREFIX@/bin/softlimit -o250 -d ${dnscache_datalimit}
-@PREFIX@/bin/argv0 @PREFIX@/bin/${name} ${procname}
-</dev/urandom 2>&1 |
+       command="@PREFIX@/bin/pgrphack @SETENV@ - ${dnscache_postenv} \
+ROOT=@PKG_SYSCONFDIR@/${name} \
+IP=${dnscache_ip} \
+IPSEND=${dnscache_ipsend} \
+CACHESIZE=${dnscache_size} \
+@PREFIX@/bin/envuidgid @DJBDNS_CACHE_USER@ \
+@PREFIX@/bin/softlimit -o250 -d ${dnscache_datalimit} \
+@PREFIX@/bin/argv0 @PREFIX@/bin/${name} ${procname} \
+</dev/urandom 2>&1 | \
 @PREFIX@/bin/pgrphack @PREFIX@/bin/setuidgid @DJBDNS_LOG_USER@ ${dnscache_logcmd}"
        command_args="&"
        rc_flags=""

Index: pkgsrc/net/djbdns-run/files/rbldns.sh
diff -u pkgsrc/net/djbdns-run/files/rbldns.sh:1.7 pkgsrc/net/djbdns-run/files/rbldns.sh:1.8
--- pkgsrc/net/djbdns-run/files/rbldns.sh:1.7   Sat Aug  5 15:16:05 2017
+++ pkgsrc/net/djbdns-run/files/rbldns.sh       Mon Jan  7 14:01:55 2019
@@ -1,6 +1,6 @@
 #!@RCD_SCRIPTS_SHELL@
 #
-# $NetBSD: rbldns.sh,v 1.7 2017/08/05 15:16:05 schmonz Exp $
+# $NetBSD: rbldns.sh,v 1.8 2019/01/07 14:01:55 schmonz Exp $
 #
 # @PKGNAME@ script to control rbldns (local RBL service).
 #
@@ -16,16 +16,19 @@ name="rbldns"
 : ${rbldns_ip:="127.0.0.3"}
 : ${rbldns_base:="rbl"}
 : ${rbldns_datalimit:="250000"}
+: ${rbldns_autocdb:="YES"}
 : ${rbldns_log:="YES"}
-: ${rbldns_logcmd:="logger -t nb${name} -p daemon.info"}
+: ${rbldns_logcmd:="logger -t nbdjbdns/rbl -p daemon.info"}
 : ${rbldns_nologcmd:="@PREFIX@/bin/multilog -*"}
 
+rbldns_data="@PKG_SYSCONFDIR@/${name}/data"
+
 if [ -f /etc/rc.subr ]; then
        . /etc/rc.subr
 fi
 
 rcvar=${name}
-required_files="@PKG_SYSCONFDIR@/${name}/data.cdb"
+required_files="${rbldns_data}"
 command="@PREFIX@/bin/${name}"
 procname=nb${name}
 start_precmd="rbldns_precmd"
@@ -33,28 +36,36 @@ extra_commands="cdb reload"
 cdb_cmd="rbldns_cdb"
 reload_cmd=${cdb_cmd}
 
-rbldns_precmd()
-{
+rbldns_precmd() {
        if [ -f /etc/rc.subr ] && ! checkyesno rbldns_log; then
                rbldns_logcmd=${rbldns_nologcmd}
        fi
-       command="@PREFIX@/bin/pgrphack @SETENV@ - ${rbldns_postenv}
-ROOT=@PKG_SYSCONFDIR@/${name} IP=${rbldns_ip} BASE=${rbldns_base}
-@PREFIX@/bin/envuidgid @DJBDNS_RBL_USER@
-@PREFIX@/bin/softlimit -d ${rbldns_datalimit}
-@PREFIX@/bin/argv0 @PREFIX@/bin/${name} ${procname}
-2>&1 |
+       if [ -f /etc/rc.subr ] && checkyesno rbldns_autocdb; then
+               rbldns_needcdb && rbldns_cdb
+       fi
+       command="@PREFIX@/bin/pgrphack @SETENV@ - ${rbldns_postenv} \
+ROOT=@PKG_SYSCONFDIR@/${name} \
+IP=${rbldns_ip} \
+BASE=${rbldns_base} \
+@PREFIX@/bin/envuidgid @DJBDNS_RBL_USER@ \
+@PREFIX@/bin/softlimit -d ${rbldns_datalimit} \
+@PREFIX@/bin/argv0 @PREFIX@/bin/${name} ${procname} \
+2>&1 | \
 @PREFIX@/bin/pgrphack @PREFIX@/bin/setuidgid @DJBDNS_LOG_USER@ ${rbldns_logcmd}"
        command_args="&"
        rc_flags=""
 }
 
-rbldns_cdb()
-{
-       @ECHO@ "Reloading @PKG_SYSCONFDIR@/${name}/data."
-       cd @PKG_SYSCONFDIR@/${name}
-       @PREFIX@/bin/rbldns-data
-       @CHMOD@ 644 data.cdb
+rbldns_needcdb() {
+       _src=${axfrdns_tcprules}
+       _dst=${axfrdns_tcprules}.cdb
+       [ -f "${_src}" -a "${_src}" -nt "${_dst}" ] || [ ! -f "${_dst}" ]
+}
+
+rbldns_cdb() {
+       @ECHO@ "Reloading ${rbldns_data}."
+       cd @PKG_SYSCONFDIR@/${name} && @PREFIX@/bin/rbldns-data
+       @CHMOD@ 644 ${rbldns_data}.cdb
 }
 
 if [ -f /etc/rc.subr ]; then

Added files:

Index: pkgsrc/net/djbdns-run/files/axfrdns-tcp
diff -u /dev/null pkgsrc/net/djbdns-run/files/axfrdns-tcp:1.1
--- /dev/null   Mon Jan  7 14:01:56 2019
+++ pkgsrc/net/djbdns-run/files/axfrdns-tcp     Mon Jan  7 14:01:55 2019
@@ -0,0 +1 @@
+:allow,AXFR=""



Home | Main Index | Thread Index | Old Index