pkgsrc-Changes-HG archive

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

[pkgsrc/trunk]: pkgsrc/net/djbdns-run Add rc.d script, user account, and inst...



details:   https://anonhg.NetBSD.org/pkgsrc/rev/cd043d3ecfa1
branches:  trunk
changeset: 488238:cd043d3ecfa1
user:      schmonz <schmonz%pkgsrc.org@localhost>
date:      Wed Jan 26 07:01:10 2005 +0000

description:
Add rc.d script, user account, and instructions for rbldns. Bump version.

diffstat:

 net/djbdns-run/MESSAGE         |  10 +++++--
 net/djbdns-run/Makefile        |   8 ++++--
 net/djbdns-run/files/rbldns.sh |  52 ++++++++++++++++++++++++++++++++++++++++++
 3 files changed, 64 insertions(+), 6 deletions(-)

diffs (116 lines):

diff -r 566f7f741495 -r cd043d3ecfa1 net/djbdns-run/MESSAGE
--- a/net/djbdns-run/MESSAGE    Wed Jan 26 05:03:11 2005 +0000
+++ b/net/djbdns-run/MESSAGE    Wed Jan 26 07:01:10 2005 +0000
@@ -1,5 +1,5 @@
 ===========================================================================
-$NetBSD: MESSAGE,v 1.1.1.1 2004/09/01 20:13:04 schmonz Exp $
+$NetBSD: MESSAGE,v 1.2 2005/01/26 07:01:10 schmonz Exp $
 
 Please read ${PREFIX}/share/doc/djbdns-run/README.pkgsrc.
 
@@ -10,8 +10,7 @@
 - Run "echo nameserver 127.0.0.1 > /etc/resolv.conf".
 
 UDP name service:
-- Set tinydns=YES in /etc/rc.conf.
-- Set tinydns_ip to a suitable IP address of the local machine.
+- 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".
 
@@ -19,4 +18,9 @@
 - 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".
+
 ===========================================================================
diff -r 566f7f741495 -r cd043d3ecfa1 net/djbdns-run/Makefile
--- a/net/djbdns-run/Makefile   Wed Jan 26 05:03:11 2005 +0000
+++ b/net/djbdns-run/Makefile   Wed Jan 26 07:01:10 2005 +0000
@@ -1,7 +1,7 @@
-# $NetBSD: Makefile,v 1.5 2004/12/29 16:35:41 schmonz Exp $
+# $NetBSD: Makefile,v 1.6 2005/01/26 07:01:10 schmonz Exp $
 #
 
-DISTNAME=              djbdns-run-20041229
+DISTNAME=              djbdns-run-20050126
 CATEGORIES=            net
 MASTER_SITES=          # empty
 DISTFILES=             # empty
@@ -24,13 +24,15 @@
 MAKE_DIRS+=            ${PKG_SYSCONFDIR}/axfrdns
 MAKE_DIRS+=            ${PKG_SYSCONFDIR}/dnscache/ip
 MAKE_DIRS+=            ${PKG_SYSCONFDIR}/dnscache/servers
+MAKE_DIRS+=            ${PKG_SYSCONFDIR}/rbldns
 MAKE_DIRS+=            ${PKG_SYSCONFDIR}/tinydns
 PKG_GROUPS=            djbdns
 PKG_USERS+=            dnslog:djbdns::dnslog
 PKG_USERS+=            axfrdns:djbdns::axfrdns
 PKG_USERS+=            dnscache:djbdns::dnscache
+PKG_USERS+=            rbldns:djbdns::rbldns
 PKG_USERS+=            tinydns:djbdns::tinydns
-RCD_SCRIPTS=           axfrdns dnscache tinydns
+RCD_SCRIPTS=           axfrdns dnscache rbldns tinydns
 FILES_SUBST+=          PKGNAME=${PKGNAME}
 
 INSTALLATION_DIRS=     bin share/doc/djbdns-run
diff -r 566f7f741495 -r cd043d3ecfa1 net/djbdns-run/files/rbldns.sh
--- /dev/null   Thu Jan 01 00:00:00 1970 +0000
+++ b/net/djbdns-run/files/rbldns.sh    Wed Jan 26 07:01:10 2005 +0000
@@ -0,0 +1,52 @@
+#!@RCD_SCRIPTS_SHELL@
+#
+# $NetBSD: rbldns.sh,v 1.1 2005/01/26 07:01:10 schmonz Exp $
+#
+# @PKGNAME@ script to control rbldns (local RBL service)
+#
+
+# PROVIDE: rbldns named
+# REQUIRE: SERVERS
+# BEFORE:  DAEMON
+
+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"}
+
+if [ -f /etc/rc.subr ]; then
+       . /etc/rc.subr
+fi
+
+rcvar=${name}
+required_files="@PKG_SYSCONFDIR@/rbldns/data.cdb"
+command="@LOCALBASE@/bin/${name}"
+start_precmd="rbldns_precmd"
+extra_commands="cdb"
+cdb_cmd="rbldns_cdb"
+
+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}"
+       command_args="&"
+       rc_flags=""
+}
+
+rbldns_cdb()
+{
+       @ECHO@ "Reloading @PKG_SYSCONFDIR@/rbldns/data."
+       cd @PKG_SYSCONFDIR@/rbldns
+       @LOCALBASE@/bin/rbldns-data
+}
+
+if [ -f /etc/rc.subr ]; then
+       load_rc_config $name
+       run_rc_command "$1"
+else
+       @ECHO_N@ " ${name}"
+       rbldns_precmd
+       eval ${command} ${rbldns_flags} ${command_args}
+fi



Home | Main Index | Thread Index | Old Index