From owner-freebsd-ports@FreeBSD.ORG Fri Jan 7 20:32:34 2011 Return-Path: Delivered-To: ports@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 23C30106573B for ; Fri, 7 Jan 2011 20:32:34 +0000 (UTC) (envelope-from dougb@FreeBSD.org) Received: from mail2.fluidhosting.com (mx22.fluidhosting.com [204.14.89.5]) by mx1.freebsd.org (Postfix) with ESMTP id BCB618FC16 for ; Fri, 7 Jan 2011 20:32:33 +0000 (UTC) Received: (qmail 9297 invoked by uid 399); 7 Jan 2011 20:32:32 -0000 Received: from localhost (HELO doug-optiplex.ka9q.net) (dougb@dougbarton.us@127.0.0.1) by localhost with ESMTPAM; 7 Jan 2011 20:32:32 -0000 X-Originating-IP: 127.0.0.1 X-Sender: dougb@dougbarton.us Message-ID: <4D27785F.3040605@FreeBSD.org> Date: Fri, 07 Jan 2011 12:32:31 -0800 From: Doug Barton Organization: http://SupersetSolutions.com/ User-Agent: Mozilla/5.0 (X11; U; FreeBSD amd64; en-US; rv:1.9.2.13) Gecko/20101210 Thunderbird/3.1.7 MIME-Version: 1.0 To: Freddie Cash References: <4D243672.4040803@douglasthrift.net> <4D266320.2020803@FreeBSD.org> <20110107030123.GB21582@atarininja.org> <20110107030327.GC21582@atarininja.org> In-Reply-To: X-Enigmail-Version: 1.1.2 OpenPGP: id=1A1ABC84 Content-Type: multipart/mixed; boundary="------------020005080409030301040606" Cc: ports@freebsd.org, Wesley Shields , Douglas Thrift , mandree@FreeBSD.org Subject: Re: FreeBSD Port: isc-dhcp41-server-4.1.2,1; Concurrent IPv4 DHCP and DHCPv6 X-BeenThere: freebsd-ports@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: Porting software to FreeBSD List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Fri, 07 Jan 2011 20:32:34 -0000 This is a multi-part message in MIME format. --------------020005080409030301040606 Content-Type: text/plain; charset=ISO-8859-1; format=flowed Content-Transfer-Encoding: 7bit On 01/06/2011 21:16, Freddie Cash wrote: > The OpenVPN port does a pretty good job of this. Default rc.d script > is just openvpn. But you can create manual symlinks to it using > openvpn_somename, and it checks rc.conf for openvpn_somename_enable. > > Having to manually create the symlink is kind of needed in the openvpn > setup and can lead to left-over files on port removal, but wouldn't be > needed for dhcpd. > > Might want to look through the openvpn rc script for ideas. Yeah, I'm actually kind of embarrassed that I didn't mention that explicitly, since I was working with openvpn the other day. :) The script can be simplified with the attached patch. The eval's are a necessary evil without some other mechanism for setting the defaults. The patch also removes the default empty variable assignments which are never necessary or desirable. hth, Doug -- Nothin' ever doesn't change, but nothin' changes much. -- OK Go Breadth of IT experience, and depth of knowledge in the DNS. Yours for the right price. :) http://SupersetSolutions.com/ --------------020005080409030301040606 Content-Type: text/plain; name="openvpn.sh.in.diff" Content-Transfer-Encoding: 7bit Content-Disposition: attachment; filename="openvpn.sh.in.diff" Index: openvpn.sh.in =================================================================== RCS file: /home/pcvs/ports/security/openvpn/files/openvpn.sh.in,v retrieving revision 1.14 diff -u -r1.14 openvpn.sh.in --- openvpn.sh.in 4 Aug 2010 19:53:56 -0000 1.14 +++ openvpn.sh.in 7 Jan 2011 20:25:58 -0000 @@ -31,7 +31,7 @@ # ----------------------------------------------------------------------------- # # This script supports running multiple instances of openvpn. -# To run additional instance link this script to something like +# To run additional instances link this script to something like # % ln -s openvpn openvpn_foo # and define additional openvpn_foo_* variables in one of # /etc/rc.conf, /etc/rc.conf.local or /etc/rc.conf.d/openvpn_foo @@ -63,25 +63,13 @@ . /etc/rc.subr -case "$0" in -/etc/rc*) - # during boot (shutdown) $0 is /etc/rc (/etc/rc.shutdown), - # so get the name of the script from $_file - name=$(basename "$_file" .sh) - ;; -*) - name=$(basename "$0" .sh) - ;; -esac +name="${0%%*/}" rcvar=$(set_rcvar) openvpn_precmd() { for i in $interfaces ; do - # FreeBSD <= 5.4 does not know kldstat's -m option - # FreeBSD >= 6.0 does not add debug.* sysctl information - # in the default build - we check both to keep things simple if ! sysctl debug.if_${i}_debug >/dev/null 2>&1 \ && ! kldstat -m if_${i} >/dev/null 2>&1 ; then if ! kldload if_${i} ; then @@ -123,8 +111,6 @@ load_rc_config ${name} eval ": \${${name}_enable:=\"NO\"}" -eval ": \${${name}_flags:=\"\"}" -eval ": \${${name}_if:=\"\"}" eval ": \${${name}_configfile:=\"%%PREFIX%%/etc/openvpn/${name}.conf\"}" eval ": \${${name}_dir:=\"%%PREFIX%%/etc/openvpn\"}" --------------020005080409030301040606--