pkgsrc-Changes-HG archive

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

[pkgsrc/trunk]: pkgsrc/net/djbdns-run Update to 20050415. Changes:



details:   https://anonhg.NetBSD.org/pkgsrc/rev/d65b051fe7cc
branches:  trunk
changeset: 492534:d65b051fe7cc
user:      schmonz <schmonz%pkgsrc.org@localhost>
date:      Fri Apr 15 05:15:55 2005 +0000

description:
Update to 20050415. Changes:

* Add "djbdns" rc.d script to control all enabled djbdns services,
    modeled after the "qmail" rc.d script from mail/qmail-run.
* Set rc.conf defaults more succinctly, modeled after mail/qmail-run.
* Add "reload" as a synonym for "cdb" in axfrdns, rbldns, and tinydns.
* Add "foo_postenv" for additional environment customization, for
    instance to run dnscache as a pure forwarder.
* Add "foo_log" booleans to enable or disable logging (enabled by default).
* Always run loggers as the "dnslog" user. This makes it simpler
    to define alternate loggers.

diffstat:

 net/djbdns-run/Makefile          |   6 +-
 net/djbdns-run/files/axfrdns.sh  |  22 ++++++++----
 net/djbdns-run/files/djbdns.sh   |  68 ++++++++++++++++++++++++++++++++++++++++
 net/djbdns-run/files/dnscache.sh |  20 +++++++----
 net/djbdns-run/files/rbldns.sh   |  22 ++++++++----
 net/djbdns-run/files/tinydns.sh  |  20 +++++++----
 6 files changed, 126 insertions(+), 32 deletions(-)

diffs (279 lines):

diff -r 971ed8895e11 -r d65b051fe7cc net/djbdns-run/Makefile
--- a/net/djbdns-run/Makefile   Fri Apr 15 05:15:05 2005 +0000
+++ b/net/djbdns-run/Makefile   Fri Apr 15 05:15:55 2005 +0000
@@ -1,7 +1,7 @@
-# $NetBSD: Makefile,v 1.6 2005/01/26 07:01:10 schmonz Exp $
+# $NetBSD: Makefile,v 1.7 2005/04/15 05:15:55 schmonz Exp $
 #
 
-DISTNAME=              djbdns-run-20050126
+DISTNAME=              djbdns-run-20050415
 CATEGORIES=            net
 MASTER_SITES=          # empty
 DISTFILES=             # empty
@@ -32,7 +32,7 @@
 PKG_USERS+=            dnscache:djbdns::dnscache
 PKG_USERS+=            rbldns:djbdns::rbldns
 PKG_USERS+=            tinydns:djbdns::tinydns
-RCD_SCRIPTS=           axfrdns dnscache rbldns tinydns
+RCD_SCRIPTS=           axfrdns djbdns dnscache rbldns tinydns
 FILES_SUBST+=          PKGNAME=${PKGNAME}
 
 INSTALLATION_DIRS=     bin share/doc/djbdns-run
diff -r 971ed8895e11 -r d65b051fe7cc net/djbdns-run/files/axfrdns.sh
--- a/net/djbdns-run/files/axfrdns.sh   Fri Apr 15 05:15:05 2005 +0000
+++ b/net/djbdns-run/files/axfrdns.sh   Fri Apr 15 05:15:55 2005 +0000
@@ -1,6 +1,6 @@
 #!@RCD_SCRIPTS_SHELL@
 #
-# $NetBSD: axfrdns.sh,v 1.3 2004/12/29 16:35:41 schmonz Exp $
+# $NetBSD: axfrdns.sh,v 1.4 2005/04/15 05:15:55 schmonz Exp $
 #
 # @PKGNAME@ script to control axfrdns (DNS zone-transfer and TCP service)
 #
@@ -12,9 +12,14 @@
 name="axfrdns"
 
 # User-settable rc.conf variables and their default values:
-axfrdns_tcpflags=${axfrdns_tcpflags-"-vDRHl0"}
-axfrdns_datalimit=${axfrdns_datalimit-"300000"}
-axfrdns_logcmd=${axfrdns_logcmd-"@LOCALBASE@/bin/setuidgid dnslog logger -t nb${name} -p daemon.info"}
+: ${axfrdns_postenv:=""}
+: ${axfrdns_tcpflags:="-vDRHl0"}
+: ${axfrdns_tcpport:="53"}
+: ${axfrdns_datalimit:="300000"}
+: ${axfrdns_pretcpserver:=""}
+: ${axfrdns_log:="YES"}
+: ${axfrdns_logcmd:="logger -t nb${name} -p daemon.info"}
+: ${axfrdns_nologcmd:="@LOCALBASE@/bin/multilog -*"}
 
 if [ -f /etc/rc.subr ]; then
        . /etc/rc.subr
@@ -25,12 +30,15 @@
 command="@LOCALBASE@/bin/tcpserver"
 procname=${name}
 start_precmd="axfrdns_precmd"
-extra_commands="cdb"
-cdb_cmd="axfrdns_cdb"
+extra_commands="reload cdb"
+reload_cmd="axfrdns_cdb"; cdb_cmd=${reload_cmd}
 
 axfrdns_precmd()
 {
-       command="@SETENV@ - ROOT=@PKG_SYSCONFDIR@/tinydns IP=${tinydns_ip} @LOCALBASE@/bin/envuidgid axfrdns @LOCALBASE@/bin/softlimit -d ${axfrdns_datalimit} @LOCALBASE@/bin/argv0 
@LOCALBASE@/bin/tcpserver ${name} ${axfrdns_tcpflags} -x @PKG_SYSCONFDIR@/axfrdns/tcp.cdb -- ${tinydns_ip} 53 @LOCALBASE@/bin/axfrdns </dev/null 2>&1 | ${axfrdns_logcmd}"
+       if [ -f /etc/rc.subr ]; then
+               checkyesno axfrdns_log || axfrdns_logcmd=${axfrdns_nologcmd}
+       fi
+       command="@SETENV@ - ${axfrdns_postenv} ROOT=@PKG_SYSCONFDIR@/tinydns IP=${tinydns_ip} @LOCALBASE@/bin/envuidgid axfrdns @LOCALBASE@/bin/softlimit -d ${axfrdns_datalimit} 
${axfrdns_pretcpserver} @LOCALBASE@/bin/argv0 @LOCALBASE@/bin/tcpserver ${name} ${axfrdns_tcpflags} -x @PKG_SYSCONFDIR@/axfrdns/tcp.cdb -- ${tinydns_ip} ${axfrdns_tcpport} @LOCALBASE@/bin/axfrdns 
</dev/null 2>&1 | @LOCALBASE@/bin/setuidgid dnslog ${axfrdns_logcmd}"
        command_args="&"
        rc_flags=""
 }
diff -r 971ed8895e11 -r d65b051fe7cc net/djbdns-run/files/djbdns.sh
--- /dev/null   Thu Jan 01 00:00:00 1970 +0000
+++ b/net/djbdns-run/files/djbdns.sh    Fri Apr 15 05:15:55 2005 +0000
@@ -0,0 +1,68 @@
+#!@RCD_SCRIPTS_SHELL@
+#
+# $NetBSD: djbdns.sh,v 1.1 2005/04/15 05:15: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
+
+if [ -f /etc/rc.subr ]; then
+       . /etc/rc.subr
+fi
+
+rcd_dir=`@DIRNAME@ $0`
+
+# NOTE: run_rc_command sets $rc_arg
+#
+forward_commands()
+{
+       # Backward compat with NetBSD <1.6:
+       [ -z "$rc_arg" ] && rc_arg=$_arg
+
+       for file in $COMMAND_LIST; do
+               $rcd_dir/$file $rc_arg
+       done
+}
+
+reverse_commands()
+{
+       # Backward compat with NetBSD <1.6:
+       [ -z "$rc_arg" ] && rc_arg=$_arg
+
+       REVCOMMAND_LIST=
+       for file in $COMMAND_LIST; do
+               REVCOMMAND_LIST="$file $REVCOMMAND_LIST"
+       done
+       for file in $REVCOMMAND_LIST; do
+               $rcd_dir/$file $rc_arg
+       done
+}
+
+djbdnsrcd()
+{
+       for service in $@; do
+               $rcd_dir/${service} $rc_arg
+       done
+}
+
+COMMAND_LIST="axfrdns dnscache rbldns tinydns"
+
+name="djbdns"
+start_cmd="forward_commands"
+stop_cmd="reverse_commands"
+reload_cmd="djbdnsrcd axfrdns rbldns tinydns"; cdb_cmd=${reload_cmd}
+status_cmd="forward_commands"
+extra_commands="status cdb reload"
+
+if [ -f /etc/rc.subr ]; then
+       run_rc_command "$1"
+else
+       _arg="$1"
+       ${start_cmd}
+fi
diff -r 971ed8895e11 -r d65b051fe7cc net/djbdns-run/files/dnscache.sh
--- a/net/djbdns-run/files/dnscache.sh  Fri Apr 15 05:15:05 2005 +0000
+++ b/net/djbdns-run/files/dnscache.sh  Fri Apr 15 05:15:55 2005 +0000
@@ -1,6 +1,6 @@
 #!@RCD_SCRIPTS_SHELL@
 #
-# $NetBSD: dnscache.sh,v 1.3 2004/12/29 16:35:41 schmonz Exp $
+# $NetBSD: dnscache.sh,v 1.4 2005/04/15 05:15:55 schmonz Exp $
 #
 # @PKGNAME@ script to control dnscache (caching DNS resolver)
 #
@@ -12,11 +12,14 @@
 name="dnscache"
 
 # User-settable rc.conf variables and their default values:
-dnscache_ip=${dnscache_ip-"127.0.0.1"}
-dnscache_ipsend=${dnscache_ipsend-"0.0.0.0"}
-dnscache_size=${dnscache_size-"1000000"}
-dnscache_datalimit=${dnscache_datalimit-"3000000"}
-dnscache_logcmd=${dnscache_logcmd-"@LOCALBASE@/bin/setuidgid dnslog logger -t nb${name} -p daemon.info"}
+: ${dnscache_postenv:=""}
+: ${dnscache_ip:="127.0.0.1"}
+: ${dnscache_ipsend:="0.0.0.0"}
+: ${dnscache_size:="1000000"}
+: ${dnscache_datalimit:="3000000"}
+: ${dnscache_log:="YES"}
+: ${dnscache_logcmd:="logger -t nb${name} -p daemon.info"}
+: ${dnscache_nologcmd:="@LOCALBASE@/bin/multilog -*"}
 
 if [ -f /etc/rc.subr ]; then
        . /etc/rc.subr
@@ -30,7 +33,10 @@
 
 dnscache_precmd()
 {
-       command="@SETENV@ - ROOT=@PKG_SYSCONFDIR@/dnscache IP=${dnscache_ip} IPSEND=${dnscache_ipsend} CACHESIZE=${dnscache_size} @LOCALBASE@/bin/envuidgid dnscache @LOCALBASE@/bin/softlimit -o250 -d 
${dnscache_datalimit} @LOCALBASE@/bin/dnscache </dev/random 2>&1 | ${dnscache_logcmd}"
+       if [ -f /etc/rc.subr ]; then
+               checkyesno dnscache_log || dnscache_logcmd=${dnscache_nologcmd}
+       fi
+       command="@SETENV@ - ${dnscache_postenv} ROOT=@PKG_SYSCONFDIR@/dnscache IP=${dnscache_ip} IPSEND=${dnscache_ipsend} CACHESIZE=${dnscache_size} @LOCALBASE@/bin/envuidgid dnscache 
@LOCALBASE@/bin/softlimit -o250 -d ${dnscache_datalimit} @LOCALBASE@/bin/dnscache </dev/random 2>&1 | @LOCALBASE@/bin/setuidgid dnslog ${dnscache_logcmd}"
        command_args="&"
        rc_flags=""
 }
diff -r 971ed8895e11 -r d65b051fe7cc net/djbdns-run/files/rbldns.sh
--- a/net/djbdns-run/files/rbldns.sh    Fri Apr 15 05:15:05 2005 +0000
+++ b/net/djbdns-run/files/rbldns.sh    Fri Apr 15 05:15:55 2005 +0000
@@ -1,6 +1,6 @@
 #!@RCD_SCRIPTS_SHELL@
 #
-# $NetBSD: rbldns.sh,v 1.1 2005/01/26 07:01:10 schmonz Exp $
+# $NetBSD: rbldns.sh,v 1.2 2005/04/15 05:15:55 schmonz Exp $
 #
 # @PKGNAME@ script to control rbldns (local RBL service)
 #
@@ -12,10 +12,13 @@
 name="rbldns"
 
 # User-settable rc.conf variables and their default values:
-rbldns_ip=${rbldns_ip-"127.0.0.3"}
-rbldns_base=${rbldns_base-"rbl"}
-rbldns_datalimit=${rbldns_datalimit-"250000"}
-rbldns_logcmd=${rbldns_logcmd-"@LOCALBASE@/bin/setuidgid dnslog logger -t nb${name} -p daemon.info"}
+: ${rbldns_postenv:=""}
+: ${rbldns_ip:="127.0.0.3"}
+: ${rbldns_base:="rbl"}
+: ${rbldns_datalimit:="250000"}
+: ${rbldns_log:="YES"}
+: ${rbldns_logcmd:="logger -t nb${name} -p daemon.info"}
+: ${rbldns_nologcmd:="@LOCALBASE@/bin/multilog -*"}
 
 if [ -f /etc/rc.subr ]; then
        . /etc/rc.subr
@@ -25,12 +28,15 @@
 required_files="@PKG_SYSCONFDIR@/rbldns/data.cdb"
 command="@LOCALBASE@/bin/${name}"
 start_precmd="rbldns_precmd"
-extra_commands="cdb"
-cdb_cmd="rbldns_cdb"
+extra_commands="reload cdb"
+reload_cmd="rbldns_cdb"; cdb_cmd=${reload_cmd}
 
 rbldns_precmd()
 {
-       command="@SETENV@ - ROOT=@PKG_SYSCONFDIR@/rbldns IP=${rbldns_ip} BASE=${rbldns_base} @LOCALBASE@/bin/envuidgid rbldns @LOCALBASE@/bin/softlimit -d ${rbldns_datalimit} @LOCALBASE@/bin/rbldns 
2>&1 | ${rbldns_logcmd}"
+       if [ -f /etc/rc.subr ]; then
+               checkyesno rbldns_log || rbldns_logcmd=${rbldns_nologcmd}
+       fi
+       command="@SETENV@ - ${rbldns_postenv} ROOT=@PKG_SYSCONFDIR@/rbldns IP=${rbldns_ip} BASE=${rbldns_base} @LOCALBASE@/bin/envuidgid rbldns @LOCALBASE@/bin/softlimit -d ${rbldns_datalimit} 
@LOCALBASE@/bin/rbldns 2>&1 | @LOCALBASE@/bin/setuidgid dnslog ${rbldns_logcmd}"
        command_args="&"
        rc_flags=""
 }
diff -r 971ed8895e11 -r d65b051fe7cc net/djbdns-run/files/tinydns.sh
--- a/net/djbdns-run/files/tinydns.sh   Fri Apr 15 05:15:05 2005 +0000
+++ b/net/djbdns-run/files/tinydns.sh   Fri Apr 15 05:15:55 2005 +0000
@@ -1,6 +1,6 @@
 #!@RCD_SCRIPTS_SHELL@
 #
-# $NetBSD: tinydns.sh,v 1.3 2004/12/29 16:35:41 schmonz Exp $
+# $NetBSD: tinydns.sh,v 1.4 2005/04/15 05:15:55 schmonz Exp $
 #
 # @PKGNAME@ script to control tinydns (authoritative DNS service)
 #
@@ -12,9 +12,12 @@
 name="tinydns"
 
 # User-settable rc.conf variables and their default values:
-tinydns_ip=${tinydns_ip-"127.0.0.2"}
-tinydns_datalimit=${tinydns_datalimit-"300000"}
-tinydns_logcmd=${tinydns_logcmd-"@LOCALBASE@/bin/setuidgid dnslog logger -t nb${name} -p daemon.info"}
+: ${tinydns_postenv:=""}
+: ${tinydns_ip:="127.0.0.2"}
+: ${tinydns_datalimit:="300000"}
+: ${tinydns_log:="YES"}
+: ${tinydns_logcmd:="logger -t nb${name} -p daemon.info"}
+: ${tinydns_nologcmd:="@LOCALBASE@/bin/multilog -*"}
 
 if [ -f /etc/rc.subr ]; then
        . /etc/rc.subr
@@ -24,12 +27,15 @@
 required_files="@PKG_SYSCONFDIR@/tinydns/data.cdb"
 command="@LOCALBASE@/bin/${name}"
 start_precmd="tinydns_precmd"
-extra_commands="cdb"
-cdb_cmd="tinydns_cdb"
+extra_commands="reload cdb"
+reload_cmd="tinydns_cdb"; cdb_cmd=${reload_cmd}
 
 tinydns_precmd()
 {
-       command="@SETENV@ - ROOT=@PKG_SYSCONFDIR@/tinydns IP=${tinydns_ip} @LOCALBASE@/bin/envuidgid tinydns @LOCALBASE@/bin/softlimit -d ${tinydns_datalimit} @LOCALBASE@/bin/tinydns </dev/null 2>&1 
| ${tinydns_logcmd}"
+       if [ -f /etc/rc.subr ]; then
+               checkyesno tinydns_log || tinydns_logcmd=${tinydns_nologcmd}
+       fi
+       command="@SETENV@ - ${tinydns_postenv} ROOT=@PKG_SYSCONFDIR@/tinydns IP=${tinydns_ip} @LOCALBASE@/bin/envuidgid tinydns @LOCALBASE@/bin/softlimit -d ${tinydns_datalimit} 
@LOCALBASE@/bin/tinydns </dev/null 2>&1 | @LOCALBASE@/bin/setuidgid dnslog ${tinydns_logcmd}"
        command_args="&"
        rc_flags=""
 }



Home | Main Index | Thread Index | Old Index