summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorThilo Bangert <bangert@gentoo.org>2002-05-13 18:30:47 +0000
committerThilo Bangert <bangert@gentoo.org>2002-05-13 18:30:47 +0000
commita3eb641d32a9fff4e66ab7fc47e5ea2b7822d113 (patch)
treed16f82d6adce4055fab0384812ae87047f41a327 /net-misc
parentnew version (diff)
downloadgentoo-2-a3eb641d32a9fff4e66ab7fc47e5ea2b7822d113.tar.gz
gentoo-2-a3eb641d32a9fff4e66ab7fc47e5ea2b7822d113.tar.bz2
gentoo-2-a3eb641d32a9fff4e66ab7fc47e5ea2b7822d113.zip
old setup scripts removed - new setup scripts added
Diffstat (limited to 'net-misc')
-rw-r--r--net-misc/djbdns/ChangeLog14
-rw-r--r--net-misc/djbdns/djbdns-1.05-r2.ebuild56
-rw-r--r--net-misc/djbdns/files/digest-djbdns-1.05-r21
-rw-r--r--net-misc/djbdns/files/dnscache-setup239
-rwxr-xr-xnet-misc/djbdns/files/svc-dnscache91
-rw-r--r--net-misc/djbdns/files/svc-tinydns30
-rw-r--r--net-misc/djbdns/files/tinydns-setup146
7 files changed, 455 insertions, 122 deletions
diff --git a/net-misc/djbdns/ChangeLog b/net-misc/djbdns/ChangeLog
index b02684e95200..9f4f962856ca 100644
--- a/net-misc/djbdns/ChangeLog
+++ b/net-misc/djbdns/ChangeLog
@@ -1,6 +1,18 @@
# ChangeLog for net-misc/djbdns
# Copyright 2002 Gentoo Technologies, Inc.; Distributed under the GPL
-# $Header: /var/cvsroot/gentoo-x86/net-misc/djbdns/ChangeLog,v 1.2 2002/03/02 02:33:18 g2boojum Exp $
+# $Header: /var/cvsroot/gentoo-x86/net-misc/djbdns/ChangeLog,v 1.3 2002/05/13 18:30:47 bangert Exp $
+
+*djbdns-1.05-r2 (13 May 2002)
+
+ 12 May 2002; Thilo Bangert <bangert@gentoo.org> .ebuild :
+
+ added LICENSE, added setup scripts (by banger@gentoo.org and gontran@gontran.net)
+ removed old setup scripts
+
+ 7 May 2002; Thilo Bangert <bangert@gentoo.org> .ebuild :
+
+ added automatic creation of users
+
*djbdns-1.05-r1 (1 Mar 2002)
diff --git a/net-misc/djbdns/djbdns-1.05-r2.ebuild b/net-misc/djbdns/djbdns-1.05-r2.ebuild
new file mode 100644
index 000000000000..d8876000de75
--- /dev/null
+++ b/net-misc/djbdns/djbdns-1.05-r2.ebuild
@@ -0,0 +1,56 @@
+# Copyright 1999-2001 Gentoo Technologies, Inc.
+# Distributed under the terms of the GNU General Public License, v2 or later
+# Author Achim Gottinger <achim@gentoo.org>
+# Maintainer Thilo Bangert <bangert@gentoo.org>
+# $Header: /var/cvsroot/gentoo-x86/net-misc/djbdns/djbdns-1.05-r2.ebuild,v 1.1 2002/05/13 18:30:47 bangert Exp $
+
+S=${WORKDIR}/${P}
+DESCRIPTION="Excellent high-performance DNS services"
+SRC_URI="http://cr.yp.to/djbdns/${P}.tar.gz"
+HOMEPAGE="http://cr.yp.to/djbdns.html"
+
+LICENSE="as-is"
+
+DEPEND="virtual/glibc"
+RDEPEND=">=sys-apps/daemontools-0.70
+ sys-apps/ucspi-tcp"
+
+src_compile() {
+ echo "gcc ${CFLAGS}" > conf-cc
+ echo "gcc" > conf-ld
+ echo "/usr" > conf-home
+ emake || die "emake failed"
+}
+
+src_install() {
+ insinto /etc
+ doins dnsroots.global
+ into /usr
+ for i in *-conf dnscache tinydns walldns rbldns pickdns axfrdns *-get *-data *-edit dnsip dnsipq dnsname dnstxt dnsmx dnsfilter random-ip dnsqr dnsq dnstrace dnstracesort
+ do
+ dobin $i
+ done
+ dodoc CHANGES FILES README SYSDEPS TARGETS TODO VERSION
+
+ dobin ${FILESDIR}/dnscache-setup
+ dobin ${FILESDIR}/tinydns-setup
+
+}
+
+pkg_postinst() {
+ groupadd nofiles
+ id dnscache || useradd -g nofiles -d /nonexistent -s /bin/false dnscache
+ id dnslog || useradd -g nofiles -d /nonexistent -s /bin/false dnslog
+ id tinydns || useradd -g nofiles -d /nonexistent -s /bin/false tinydns
+
+ echo
+ einfo "Use dnscache-setup and tinydns-setup to help you configure your nameservers!"
+ echo
+}
+
+pkg_postrm() {
+ userdel dnscache
+ userdel dnslog
+ userdel tinydns
+}
+
diff --git a/net-misc/djbdns/files/digest-djbdns-1.05-r2 b/net-misc/djbdns/files/digest-djbdns-1.05-r2
new file mode 100644
index 000000000000..7f303eca6ac3
--- /dev/null
+++ b/net-misc/djbdns/files/digest-djbdns-1.05-r2
@@ -0,0 +1 @@
+MD5 3147c5cd56832aa3b41955c7a51cbeb2 djbdns-1.05.tar.gz 85648
diff --git a/net-misc/djbdns/files/dnscache-setup b/net-misc/djbdns/files/dnscache-setup
new file mode 100644
index 000000000000..b9795c36923a
--- /dev/null
+++ b/net-misc/djbdns/files/dnscache-setup
@@ -0,0 +1,239 @@
+#!/bin/bash
+
+#for einfo, ewarn etc..
+. /sbin/functions.sh
+
+setup() {
+ echo
+ echo
+ einfo "Dnscache Setup"
+ echo
+ echo
+ echo ">>> More information on this package can be found at"
+ echo ">>> http://cr.yp.to/djbdns.html and http://djbdns.org"
+ echo
+ echo "After this script completes, dnscache will be configured."
+ echo "Your /etc/resolv.conf will be updated so that all DNS"
+ echo "lookups will be directed to dnscache."
+ echo
+ echo "Your original /etc/resolv.conf will be backed up to "
+ echo "/etc/resolv.conf.orig."
+ echo
+ echo "If you have previously setup dnscache, those directories will"
+ echo "not be overwritten. To redo setup, delete your dnscache"
+ echo "dirs first or choose a different install location."
+ echo
+ echo '(press enter to begin setup, or press control-C to abort)'
+ echo
+ read
+
+ echo
+ einfo "Install location"
+ echo
+ echo "Where do you want dnscache installed?"
+ echo "Ex. Default (/var) will install dnscache in /var/dnscache,"
+ echo "or an external cache in /var/dnscachex."
+ echo "!!No trailing slash!!"
+ echo
+ read -p "[/var]> " mypath
+ echo
+
+ if [ "$mypath" == "" ]
+ then
+ mypath="/var"
+ fi
+
+ if [ ! -e ${mypath} ]
+ then
+ echo ">>> Creating ${mypath}..."
+ mkdir $mypath
+ fi
+
+ echo
+ echo
+ einfo "Internal or external cache?"
+ echo
+ echo "Specify an address to which dnscache should bind."
+ echo "If this is the only machine accessing dnscache,"
+ echo "127.0.0.1 is a good start."
+ echo "Currently running IP addresses:"
+ echo
+
+ # grab interfaces
+ addrs=`ifconfig -a | grep "inet addr" | cut -f2 -d":" | cut -f1 -d" "`
+
+ echo $addrs
+ echo
+ read -p "IP to bind cache to [127.0.0.1]> " myip
+ echo
+
+ if [ "$myip" == "" ]
+ then
+ myip="127.0.0.1"
+ mycachedir="dnscache"
+ else
+ mycachedir="dnscachex"
+ fi
+
+ # check for existance of users dnscache and dnslog:
+ echo
+ echo
+ einfo "Checking for dnscache and dnslog user accts ..."
+ echo
+ /usr/bin/grep nofiles /etc/group &> /dev/null
+ if [ $? -ne 0 ]
+ then
+ echo ">>> Adding group nofiles ..."
+ /usr/sbin/groupadd nofiles &> /dev/null
+ fi
+
+ /usr/bin/grep dnscache /etc/passwd &> /dev/null
+ if [ $? -ne 0 ]
+ then
+ echo ">>> Adding user dnscache ..."
+ /usr/sbin/useradd -d /dev/null -s /bin/false -g nofiles \
+ dnscache &> /dev/null
+ fi
+
+ /usr/bin/grep dnslog /etc/passwd &> /dev/null
+ if [ $? -ne 0 ]
+ then
+ echo ">>> Adding user dnslog ..."
+ /usr/sbin/useradd -d /dev/null -s /bin/false -g nofiles \
+ dnslog &> /dev/null
+ fi
+
+ if [ ! -e ${mypath}/${mycachedir} ]
+ then
+ /usr/bin/dnscache-conf dnscache dnslog \
+ ${mypath}/${mycachedir} ${myip}
+ else
+ ewarn "*** dnscache directory currently exists, nothing done."
+ fi
+
+ echo
+ echo
+ einfo "Configure a forward for dnscache?"
+ echo
+ echo "dnscache can be configured to forward queries to another"
+ echo "nameserver (such as the nameserver of your ISP) rather than "
+ echo "perform the lookups itself. If you would like to enable this "
+ echo "forwarding mode (a good idea most of the time), then enter the "
+ echo "IP's of your forwarding nameservers now,"
+ echo "otherwise just hit Enter."
+ echo
+ read -p "enter forward-to IP> " myforward
+ echo
+ if [ "$myforward" != "" ]
+ then
+ echo $myforward > ${mypath}/${mycachedir}/root/servers/\@
+ echo -n "1" > ${mypath}/${mycachedir}/env/FOWARDONLY
+
+ read -p "enter forward-to IP [hit Enter to stop]> " myforward
+ while [ "$myforward" != "" ]
+ do
+ echo $myforward >> ${mypath}/${mycachedir}/root/servers/\@
+ read -p "enter forward-to IP [hit Enter to stop]> " myforward
+ done
+ echo ">>> Setting up forwarding..."
+ fi
+
+ if [ "$myip" != "127.0.0.1" ]
+ then
+ echo
+ echo
+ einfo "Configuring clients"
+ echo
+ echo "dnscache by default only allows 127.0.0.1 to access it."
+ echo "You have to specify the IP addresses of the clients"
+ echo "that shall be allowed to use dnscache."
+ echo
+ echo "1.2.3.4 would allow host 1.2.3.4"
+ echo "1.2.3 would allow all hosts underneath 1.2.3.x"
+ echo
+ echo "Just hit Enter if you do not want to specify clients!"
+ echo
+
+ read -p "Enter IP> " myclientip
+
+ while [ "$myclientip" != "" ]
+ do
+ touch ${mypath}/${mycachedir}/root/ip/${myclientip}
+ read -p "Enter IP (hit Enter to stop)>" myclientip
+ done
+ fi
+
+ echo
+ echo
+ einfo "Misc"
+ echo
+ if [ ! -e /var/log/dnscache ]
+ then
+ echo ">>> linking /var/log/${mycachedir} to the $mycachedir log..."
+ ln -s ${mypath}/${mycachedir}/log/main /var/log/${mycachedir}
+ fi
+
+ if [ -e /etc/resolv.conf ]
+ then
+ /usr/bin/grep $myip /etc/resolv.conf &> /dev/null
+ if [ $? -ne 0 ]
+ then
+ echo ">>> Backing up /etc/resolv.conf to resolv.conf.orig..."
+ cp /etc/resolv.conf /etc/resolv.conf.orig
+ cat /etc/resolv.conf.orig | grep -v nameserver > /etc/resolv.conf
+ echo ">>> Removed nameserver entries from resolv.conf..."
+ echo nameserver $myip >> /etc/resolv.conf
+ echo
+ echo ">>> Added \"nameserver ${myip}\" to /etc/resolv.conf!"
+ else
+ echo ">>> ${myip} is already in /etc/resolv.conf - nothing done!"
+ fi
+ else
+ echo nameserver $myip >> /etc/resolv.conf
+ echo
+ echo ">>> Added \"nameserver ${myip}\" to /etc/resolv.conf!"
+ fi
+
+ #TODO
+ #configure cachsize - $mypath/env/CACHESIZE
+
+ #TODO
+ #configure datalimit - $mypath/env/DATALIMIT
+
+ echo
+ echo
+ einfo "Start service"
+ echo
+ echo "dnscache is ready for startup."
+ echo "Do you want dnscache to be started and"
+ echo "supervised by daemontools now?"
+
+ echo
+ echo "This requires svscan (daemontools) to be running currently and"
+ echo "monitoring /service !!"
+ echo
+ echo '(press control-C to abort)'
+ read
+
+ # check in /mnt/.init.d to find svscan link in running...
+ # if not running execute /etc/init.d/svscan start
+
+ ln -sf ${mypath}/${mycachedir} /service/${mycachedir}
+
+ echo
+ echo
+ einfo "Installation successfull"
+ echo
+}
+
+# check for root user
+
+if [ `id -u` -ne 0 ]
+then
+ eerror "${0}: must be root."
+ exit 1
+fi
+
+
+# run setup
+setup
diff --git a/net-misc/djbdns/files/svc-dnscache b/net-misc/djbdns/files/svc-dnscache
deleted file mode 100755
index 63d272931e64..000000000000
--- a/net-misc/djbdns/files/svc-dnscache
+++ /dev/null
@@ -1,91 +0,0 @@
-#!/bin/sh
-#RCUPDATE:3 4:80:This line is required for script management
-
-. /etc/rc.d/config/functions
-
-SERVICE="dnscache"
-opts="setup start stop"
-
-#this service is designed to *only* run supervised
-
-setup() {
- einfo "${SERVICE} Setup"
- echo
- echo "After completing this setup process, your system will be configured to run a"
- echo "dnscache service. This service caches DNS (domain name service) lookups; in"
- echo "other words, it speeds up the time it takes for your machine to resolve hostnames."
- echo "More information on this package can be found at http://cr.yp.to/djbdns.html."
- echo
- einfo "After this script completes, dnscache will be configured and running. Your"
- einfo "/etc/resolv.conf will be updated so that all DNS lookups are directed to dnscache."
- einfo "Your original /etc/resolv.conf will be backed up to /etc/resolv.conf.orig."
- einfo "In addition, dnscache will be configured to start every time your system boots."
- echo
- echo "(press any key to begin setup, or press control-C to abort)"
- echo
- read
- echo
- addrs=`ifconfig -a | grep "inet addr" | cut -f2 -d":" | cut -f1 -d" "`
- echo "The dnscache program binds to a single IP address. Please enter the IP"
- echo "address to which dnscache should bind. Currently available IP addresses:"
- echo
- echo $addrs
- echo
- read -p "enter IP> " myip
-
- if [ ! -e /var/lib/supervise/services/dnscache ]
- then
- einfo ">>> Setting up dnscache..."
- /usr/bin/dnscache-conf dnscache dnslog /var/lib/supervise/services/dnscache $myip
- fi
- echo "dnscache can be configured to forward queries to another nameserver"
- echo "(such as the nameserver of your ISP) rather than perform the lookups"
- echo "itself. If you would like to enable this forwarding mode (a good idea"
- echo "most of the time), then enter the IP of your ISP\'s nameserver now,"
- echo "otherwise just hit Enter."
- echo
- read -p "enter IP> " myforward
- if [ "$myforward" != "" ]
- then
- echo "Forwarding requests to $myforward"
- echo $myforward > /var/lib/supervise/services/dnscache/root/servers/\@
- fi
- start
- if [ ! -e /var/log/${SERVICE}.d ]
- then
- einfo ">>> /var/log/${SERVICE}.d points to the dnscache log..."
- ln -s ${SVCDIR}/services/dnscache/log/main /var/log/${SERVICE}.d
- fi
- if [ -e /etc/resolv.conf ]
- then
- einfo ">>> Backing up /etc/resolv.conf to resolv.conf.orig..."
- cp /etc/resolv.conf /etc/resolv.conf.orig
- cat /etc/resolv.conf.orig | grep -v nameserver > /etc/resolv.conf
- echo nameserver $myip >> /etc/resolv.conf
- einfo ">>> New /etc/resolv.conf has been created."
- fi
- echo
- einfo ">>> Configuring ${SERVICE} to start at system boot..."
- /usr/sbin/rc-update add svc-dnscache
- einfo "${SERVICE} setup is complete!"
-}
-
-start() {
- ebegin "Starting svc-${SERVICE}"
- ln -sf ../services/${SERVICE} ${SVCDIR}/control/${SERVICE}
- eend $?
-}
-
-stop() {
- ebegin "Stopping svc-${SERVICE}"
- if [ -e ${SVCDIR}/control/${SERVICE} ]
- then
- /usr/bin/svc -dx ${SVCDIR}/control/${SERVICE}/log
- /usr/bin/svc -dx ${SVCDIR}/control/${SERVICE}
- rm ${SVCDIR}/control/${SERVICE}
- fi
- eend $?
-}
-
-doservice ${@}
-
diff --git a/net-misc/djbdns/files/svc-tinydns b/net-misc/djbdns/files/svc-tinydns
deleted file mode 100644
index a620ebd4d4ab..000000000000
--- a/net-misc/djbdns/files/svc-tinydns
+++ /dev/null
@@ -1,30 +0,0 @@
-#!/bin/sh
-#RCUPDATE:3 4:80:This line is required for script management
-
-. /etc/rc.d/config/functions
-
-SERVICE="tinydns"
-opts="start stop"
-
-#this service is designed to *only* run supervised
-
-
-start() {
- ebegin "Starting svc-${SERVICE}"
- ln -sf ../services/${SERVICE} ${SVCDIR}/control/${SERVICE}
- eend $?
-}
-
-stop() {
- ebegin "Stopping svc-${SERVICE}"
- if [ -e ${SVCDIR}/control/${SERVICE} ]
- then
- /usr/bin/svc -dx ${SVCDIR}/control/${SERVICE}/log
- /usr/bin/svc -dx ${SVCDIR}/control/${SERVICE}
- rm ${SVCDIR}/control/${SERVICE}
- fi
- eend $?
-}
-
-doservice ${@}
-
diff --git a/net-misc/djbdns/files/tinydns-setup b/net-misc/djbdns/files/tinydns-setup
new file mode 100644
index 000000000000..f12bfaaf39b7
--- /dev/null
+++ b/net-misc/djbdns/files/tinydns-setup
@@ -0,0 +1,146 @@
+#!/bin/bash
+
+#
+# source functions.sh for einfo, eerror and ewarn
+. /sbin/functions.sh
+
+setup() {
+ echo
+ echo
+ einfo "tinydns Setup"
+ echo
+ echo ">>> More information on this package can be found at"
+ echo ">>> http://cr.yp.to/djbdns/tinydns.html"
+ echo
+ echo "If you have previously setup tinydns, those directories will"
+ echo "not be overwritten. To redo setup, delete your"
+ echo "tinydns dir tree first."
+ echo
+ echo '(press enter to begin setup, or press control-C to abort)'
+ echo
+ read
+
+ echo
+ einfo "Install location"
+ echo
+ echo "Where do you want tinydns installed?"
+ echo "Ex. /var would install dnscache in /var/tinydns."
+ echo "!!No trailing slash!!"
+ echo
+ read -p "[/var]> " mypath
+ echo
+
+ if [ "$mypath" == "" ]
+ then
+ mypath="/var"
+ fi
+
+ if [ ! -e ${mypath} ]
+ then
+ echo ">>> Creating ${mypath}..."
+ mkdir $mypath
+ fi
+
+ # check for existance of users dnscache and dnslog:
+ echo
+ echo
+ einfo "Checking for tinydns and dnslog user accts ..."
+ echo
+ /usr/bin/grep nofiles /etc/group &> /dev/null
+ if [ $? -ne 0 ]
+ then
+ echo ">>> Adding group nofiles ..."
+ /usr/sbin/groupadd nofiles &> /dev/null
+ fi
+
+ /usr/bin/grep tinydns /etc/passwd &> /dev/null
+ if [ $? -ne 0 ]
+ then
+ echo ">>> Adding user dnscache ..."
+ /usr/sbin/useradd -d /dev/null -s /bin/false -g nofiles \
+ dnscache &> /dev/null
+ fi
+
+ /usr/bin/grep dnslog /etc/passwd &> /dev/null
+ if [ $? -ne 0 ]
+ then
+ echo ">>> Adding user dnslog ..."
+ /usr/sbin/useradd -d /dev/null -s /bin/false -g nofiles \
+ dnslog &> /dev/null
+ fi
+
+
+ # grab interfaces
+ addrs=`ifconfig -a | grep "inet addr" | cut -f2 -d":" | cut -f1 -d" "`
+
+ echo "Specify an address to which tinydns should bind."
+ echo "NOTICE: tinydns must be able to bind to port 53 on "
+ echo "choosen ip address! udp by tinydns - tcp by axfrdns"
+ echo "Usually this is NOT 127.0.0.1"
+ echo "Currently running IP addresses:"
+ echo
+ echo $addrs
+ echo
+
+ while [ "$myip" = "" ]
+ do
+ read -p "IP to bind nameserver to>" myip
+ done
+ echo
+
+ if [ ! -e ${mypath}/tinydns ]
+ then
+ einfo "Setting up tinydns..."
+ /usr/bin/tinydns-conf tinydns dnslog \
+ ${mypath}/tinydns $myip
+ else
+ ewarn "*** tinydns directory currently exists, nothing done."
+ fi
+
+ #add afxrdns
+ if [ ! -e ${mypath}/axfrdns ]
+ then
+ einfo "Setting up axfrdns..."
+ /usr/bin/axfrdns-conf tinydns dnslog \
+ ${mypath}/axfrdns ${mypath}/tinydns $myip
+ else
+ ewarn "*** axfrdns directory currently exists, nothing done."
+ fi
+
+ #grant access to axfrdns
+
+ echo
+ echo
+ einfo "Start service"
+ echo
+ echo "tinydns is ready for startup."
+ echo "Do you want dnscache to be started and"
+ echo "supervised by daemontools now?"
+
+ echo
+ echo "This requires daemontools to supervise"
+ echo "/service !!"
+ echo
+ echo '(press control-C to abort)'
+ read
+
+ ln -sf ${mypath}/tinydns /service/
+ ln -sf ${mypath}/axfrdns /service/
+
+ echo
+ echo
+ einfo "Installation successfull"
+ echo
+
+}
+
+# check for root user!
+if [ `id -u` -ne 0 ]
+then
+ eerror "${0}: must be root."
+ exit 1
+fi
+
+
+# run setup
+setup