Subject: Re: tinydns usuage?
To: None <netbsd-users@netbsd.org>
From: Daniel Cox <dc@microbits.com.au>
List: netbsd-users
Date: 04/24/2003 14:21:43
I have created and been using this script for a long time now. TinyDNS, =
... are fantastic and the zone files so easy to manage.

You will simply need to set svscan=3DYES in rc.conf

It correctly shuts down all managed services before killing svscan itself.
=3D=3D=3D=3D=3D /etc/rc.d/svscan

#!/bin/sh
#
# svscan
#

# PROVIDE: svscan
# REQUIRE: DAEMON

. /etc/rc.subr

name=3D"svscan"
rcvar=3D${name}
command=3D"/usr/pkg/bin/${name}"
pidfile=3D"/var/run/${name}.pid"
required_dirs=3D"/service"

dostart()
{
        if [ -n "$rc_pid" ]; then
            echo "${name} already running? (pid=3D$rc_pid)."
            exit 1
        fi=20
        echo "Starting ${name}."
        _doit=3D"\
env -i PATH=3D/usr/pkg/bin:/usr/sbin:/usr/bin:/bin \
sh -cf \"exec svscan /service\" &"
        if ! eval $_doit; then
                return 1
        fi
        echo $! >$pidfile
}

dostop()
{
	for i in /service/*; do
		svc -dx $i
	done
	pkill supervise
	rm ${pidfile}
}

start_cmd=3Ddostart
stop_postcmd=3Ddostop

load_rc_config $name
run_rc_command "$1"

=3D=3D=3D=3D=3D END




>>> Simon Burge <simonb@wasabisystems.com> 04/24/03 14:12 PM >>>
Caffeinate The World wrote:

> I'm about to switch one of my system from bind to tinydns. Anyone using
> tinydns? Any critiques? Praises? It seems like a nice little package.
>=20
> One problem I perceive is NetBSD rc.d  has control over the order of
> script startup. Since svscan doesn't know about order, and named
> variable is needed in rc.d before other services can start that could
> cause some problems.
>=20
> What I was thinking was creating a different /etc/rc.d/named and use
> supervise to start up tinydns manually to get named variable up for
> other scripts. svscan will start up later and will notics that tinydns
> has already started.
>=20
> I'd like to hear from your experience if you do use it.

I have no idea if this will work (maybe someone who has played with the
new rc setup more would know), but I wonder if putting something like:

	name=3D"named"
	rcvar=3D$name
	command=3D"/path/to/tinydns"=20
	pidfile=3D"/var/run/${name}.pid"
	start_precmd=3D":"
	extra_commands=3D":"
	required_dirs=3D""

in /etc/rc.conf.d/named would work?  That way you can keep the existing
dependancy on the "named" keyword.  Note I've also never used tinydns
either :-)

Simon.
--
Simon Burge                            <simonb@wasabisystems.com>
NetBSD Support and Service:         http://www.wasabisystems.com/