From owner-freebsd-rc@FreeBSD.ORG Tue Sep 11 23:20:53 2012 Return-Path: Delivered-To: freebsd-rc@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [69.147.83.52]) by hub.freebsd.org (Postfix) with ESMTP id 39C0C106564A for ; Tue, 11 Sep 2012 23:20:53 +0000 (UTC) (envelope-from list_freebsd@bluerosetech.com) Received: from rush.bluerosetech.com (rush.bluerosetech.com [199.48.134.58]) by mx1.freebsd.org (Postfix) with ESMTP id 153EE8FC0A for ; Tue, 11 Sep 2012 23:20:53 +0000 (UTC) Received: from vivi.cat.pdx.edu (vivi.cat.pdx.edu [IPv6:2610:10:20:214::6]) by rush.bluerosetech.com (Postfix) with ESMTPSA id 50D3C1141D; Tue, 11 Sep 2012 16:20:44 -0700 (PDT) Received: from [127.0.0.1] (c-76-27-220-79.hsd1.wa.comcast.net [76.27.220.79]) by vivi.cat.pdx.edu (Postfix) with ESMTPSA id C874224CDF; Tue, 11 Sep 2012 16:20:42 -0700 (PDT) Message-ID: <504FC74D.8000100@bluerosetech.com> Date: Tue, 11 Sep 2012 16:20:45 -0700 From: Darren Pilgrim User-Agent: Mozilla/5.0 (Windows NT 6.1; rv:10.0.6esrpre) Gecko/20120713 Thunderbird/10.0.6 MIME-Version: 1.0 To: Jaap Akkerhuis References: <504CA201.3090607@gmail.com> <201209101210.q8ACAGug010448@bela.nlnetlabs.nl> <504DDC9F.6010802@gmail.com> <201209111444.q8BEiBsj065335@bela.nlnetlabs.nl> In-Reply-To: <201209111444.q8BEiBsj065335@bela.nlnetlabs.nl> Content-Type: text/plain; charset=ISO-8859-1; format=flowed Content-Transfer-Encoding: 7bit Cc: freebsd-rc@freebsd.org Subject: dns/nsd RC script patch X-BeenThere: freebsd-rc@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: "Discussion related to /etc/rc.d design and implementation." List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Tue, 11 Sep 2012 23:20:53 -0000 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.