Date: Tue, 11 Sep 2012 16:20:45 -0700 From: Darren Pilgrim <list_freebsd@bluerosetech.com> To: Jaap Akkerhuis <jaap@NLnetLabs.nl> Cc: freebsd-rc@freebsd.org Subject: dns/nsd RC script patch Message-ID: <504FC74D.8000100@bluerosetech.com> In-Reply-To: <201209111444.q8BEiBsj065335@bela.nlnetlabs.nl> References: <504CA201.3090607@gmail.com> <201209101210.q8ACAGug010448@bela.nlnetlabs.nl> <504DDC9F.6010802@gmail.com> <201209111444.q8BEiBsj065335@bela.nlnetlabs.nl>
next in thread | previous in thread | raw e-mail | index | archive | help
Jaap Akkerhuis asked that I post here for discussion of a patch I emailed to him for the NSD port. The patch is question may be found here: http://shibboleet.com/files_nsd.in.patch.txt The patch adds the ability to run multiple NSD instances using an eval hack I originally saw in the isc-dhcpd RC script. Changes: - Introduce a new RC variable, ${name}_conf, which defaults to the current, built-in value (%%PREFIX%%/etc/nsd/nsd.conf) for the base case; - Add extra RC commands for the notify, patch, rebuild and update nsdc commands. The "added complexity" is two parts: 1. Add logic to get the basename used to invoke the script and rename nsd_enable and nsd_conf to match. 2. Make the RC script the single point of control for NSD instances. Add the rest of the nsdc commands to the RC script's extra_commands. Remembering which config file is which instance might be bothersome, so instead of doing: nsdc -c /usr/local/etc/nsdfoo.conf rebuild You can now just do: /usr/local/etc/rc.d/nsdfoo rebuild Adding an instance named "nsdfoo": 1. Create the NSD config (default is /usr/local/etc/nsd/nsdfoo.conf). It will need a separate pidfile, database, difffile and xfrdfile. You should also have separate zonesdir locations, but they can be shared in some cases. 2. Add 'nsdfoo_enable="YES"' to /etc/rc.conf. 3. cd /usr/local/etc/rc.d && ln -s nsd nsdfoo 4. /usr/local/etc/rc.d/nsdfoo start If you don't want to keep all your instance configs in the same directory (or just not follow the default naming), then replace step 2 with: 2. Add 'nsdfoo_conf="/path/to/conf"' and 'nsdfoo_enable="YES"' to /etc/rc.conf.
Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?504FC74D.8000100>