summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorDaniel Robbins <drobbins@gentoo.org>2001-01-10 07:05:01 +0000
committerDaniel Robbins <drobbins@gentoo.org>2001-01-10 07:05:01 +0000
commitd67bb702c2c32f54c8d867a7e6797ee40d843e2c (patch)
tree1eccabb4e862884b43a94621b5418e0fd2ed4717 /net-misc/djbdns
parentsupervise and initscript update (diff)
downloadhistorical-d67bb702c2c32f54c8d867a7e6797ee40d843e2c.tar.gz
historical-d67bb702c2c32f54c8d867a7e6797ee40d843e2c.tar.bz2
historical-d67bb702c2c32f54c8d867a7e6797ee40d843e2c.zip
supervise and initscript update
Diffstat (limited to 'net-misc/djbdns')
-rw-r--r--net-misc/djbdns/djbdns-1.02-r1.ebuild (renamed from net-misc/djbdns/djbdns-1.02.ebuild)4
-rwxr-xr-xnet-misc/djbdns/files/dnscache71
-rwxr-xr-xnet-misc/djbdns/files/svc-dnscache91
3 files changed, 93 insertions, 73 deletions
diff --git a/net-misc/djbdns/djbdns-1.02.ebuild b/net-misc/djbdns/djbdns-1.02-r1.ebuild
index f67e5ad68be7..2330cee01977 100644
--- a/net-misc/djbdns/djbdns-1.02.ebuild
+++ b/net-misc/djbdns/djbdns-1.02-r1.ebuild
@@ -1,7 +1,7 @@
# Copyright 1999-2000 Gentoo Technologies, Inc.
# Distributed under the terms of the GNU General Public License, v2 or later
# Author Achim Gottinger <achim@gentoo.org>
-# $Header: /var/cvsroot/gentoo-x86/net-misc/djbdns/djbdns-1.02.ebuild,v 1.2 2001/01/01 18:45:15 drobbins Exp $
+# $Header: /var/cvsroot/gentoo-x86/net-misc/djbdns/djbdns-1.02-r1.ebuild,v 1.1 2001/01/10 07:04:58 drobbins Exp $
A=${P}.tar.gz
S=${WORKDIR}/${P}
@@ -35,7 +35,7 @@ src_install() {
doins dnsroots.global
dodoc CHANGES FILES README SYSDEPS TARGETS TODO VERSION
exeinto /etc/rc.d/init.d
- doexe ${FILESDIR}/dnscache
+ doexe ${FILESDIR}/svc-dnscache
}
diff --git a/net-misc/djbdns/files/dnscache b/net-misc/djbdns/files/dnscache
deleted file mode 100755
index d2e7656bcdee..000000000000
--- a/net-misc/djbdns/files/dnscache
+++ /dev/null
@@ -1,71 +0,0 @@
-#!/bin/sh
-#RCUPDATE:3 4:80:This line is required for script management
-
-. /etc/rc.d/config/basic
-. /etc/rc.d/config/functions
-
-SERVICE=`basename ${0}`
-SVCDIR=/var/supervise/${SERVICE}
-CTLDIR=/etc/supervise/${SERVICE}
-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 the"
- 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, djbdns 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
- if [ ! -e ${SVCDIR} ]
- then
- einfo ">>> Setting up ${SVCDIR}..."
- /usr/bin/dnscache-conf dnscache dnslog ${SVCDIR}
- einfo ">>> Creating ${CTLDIR} symlink..."
- ln -s ${SVCDIR} ${CTLDIR}
- fi
- if [ ! -e /var/log/${SERVICE}.d ]
- then
- einfo ">>> /var/log/${SERVICE}.d points to the dnscache log..."
- ln -s ${SVCDIR}/log/main /var/log/${SERVICE}.d
- fi
- if [ -e /etc/resolv.conf ]
- then
- einfo ">>> Backing up /etc/resolv.conf..."
- cp /etc/resolv.conf /etc/resolv.conf.orig
- cat /etc/resolv.conf.orig | grep -v nameserver > /etc/resolv.conf
- echo nameserver 127.0.0.1 >> /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 dnscache
- einfo "${SERVICE} setup is complete!"
-}
-
-start() {
- ebegin "Starting supervised ${SERVICE}"
- /usr/bin/svc -u ${CTLDIR}
- /usr/bin/svc -u ${CTLDIR}/log
- eend $? "Error starting ${SERVICE} supervised."
-}
-
-stop() {
- ebegin "Stopping supervised ${SERVICE}"
- /usr/bin/svc -d ${CTLDIR}
- /usr/bin/svc -d ${CTLDIR}/log
- eend $? "Error stopping ${SERVICE} supervised"
-}
-
-doservice ${@}
-
diff --git a/net-misc/djbdns/files/svc-dnscache b/net-misc/djbdns/files/svc-dnscache
new file mode 100755
index 000000000000..e4b585a2785a
--- /dev/null
+++ b/net-misc/djbdns/files/svc-dnscache
@@ -0,0 +1,91 @@
+#!/bin/sh
+#RCUPDATE:3 4:80:This line is required for script management
+
+. /etc/rc.d/config/functions
+
+SERVICE=`basename ${0}`
+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}/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 ${SERVICE}"
+ ln -sf ../services/${SERVICE} ${SVCDIR}/control/${SERVICE}
+ eend $?
+}
+
+stop() {
+ ebegin "Stopping ${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 ${@}
+