summaryrefslogtreecommitdiff
path: root/net/djbdns-run
diff options
context:
space:
mode:
authorschmonz <schmonz@pkgsrc.org>2005-04-15 05:15:55 +0000
committerschmonz <schmonz@pkgsrc.org>2005-04-15 05:15:55 +0000
commit7add8e3264821f10267d2ae1bacf28382a3f9d9f (patch)
tree36483b029f19b95e25f2970910ad1ed8207808c7 /net/djbdns-run
parent03120540d8647097537ad00ddbcb70aa66264511 (diff)
downloadpkgsrc-7add8e3264821f10267d2ae1bacf28382a3f9d9f.tar.gz
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 (limited to 'net/djbdns-run')
-rw-r--r--net/djbdns-run/Makefile6
-rw-r--r--net/djbdns-run/files/axfrdns.sh22
-rw-r--r--net/djbdns-run/files/djbdns.sh68
-rw-r--r--net/djbdns-run/files/dnscache.sh20
-rw-r--r--net/djbdns-run/files/rbldns.sh22
-rw-r--r--net/djbdns-run/files/tinydns.sh20
6 files changed, 126 insertions, 32 deletions
diff --git a/net/djbdns-run/Makefile b/net/djbdns-run/Makefile
index c04db5d1f70..b2c69114a59 100644
--- a/net/djbdns-run/Makefile
+++ b/net/djbdns-run/Makefile
@@ -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+= axfrdns:djbdns::axfrdns
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 --git a/net/djbdns-run/files/axfrdns.sh b/net/djbdns-run/files/axfrdns.sh
index f9aaf862049..beca522b1c6 100644
--- a/net/djbdns-run/files/axfrdns.sh
+++ b/net/djbdns-run/files/axfrdns.sh
@@ -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 @@ required_files="@PKG_SYSCONFDIR@/axfrdns/tcp.cdb"
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 --git a/net/djbdns-run/files/djbdns.sh b/net/djbdns-run/files/djbdns.sh
new file mode 100644
index 00000000000..c14352323e4
--- /dev/null
+++ b/net/djbdns-run/files/djbdns.sh
@@ -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 --git a/net/djbdns-run/files/dnscache.sh b/net/djbdns-run/files/dnscache.sh
index 4a7f5a95d80..fba94bf1b65 100644
--- a/net/djbdns-run/files/dnscache.sh
+++ b/net/djbdns-run/files/dnscache.sh
@@ -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 @@ start_precmd="dnscache_precmd"
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 --git a/net/djbdns-run/files/rbldns.sh b/net/djbdns-run/files/rbldns.sh
index 63499b6434e..594d6416afb 100644
--- a/net/djbdns-run/files/rbldns.sh
+++ b/net/djbdns-run/files/rbldns.sh
@@ -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 @@ rcvar=${name}
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 --git a/net/djbdns-run/files/tinydns.sh b/net/djbdns-run/files/tinydns.sh
index 42cb1e0e7e0..c641bb22dce 100644
--- a/net/djbdns-run/files/tinydns.sh
+++ b/net/djbdns-run/files/tinydns.sh
@@ -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 @@ rcvar=${name}
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=""
}