Date: Fri, 07 Jan 2011 12:32:31 -0800 From: Doug Barton <dougb@FreeBSD.org> To: Freddie Cash <fjwcash@gmail.com> Cc: ports@freebsd.org, Wesley Shields <wxs@freebsd.org>, Douglas Thrift <douglas@douglasthrift.net>, mandree@FreeBSD.org Subject: Re: FreeBSD Port: isc-dhcp41-server-4.1.2,1; Concurrent IPv4 DHCP and DHCPv6 Message-ID: <4D27785F.3040605@FreeBSD.org> In-Reply-To: <AANLkTimjayOAsWKx%2BhtWdf_9L8Jvr%2BFc8nKyXakr-T9u@mail.gmail.com> References: <4D243672.4040803@douglasthrift.net> <4D266320.2020803@FreeBSD.org> <20110107030123.GB21582@atarininja.org> <20110107030327.GC21582@atarininja.org> <AANLkTimjayOAsWKx%2BhtWdf_9L8Jvr%2BFc8nKyXakr-T9u@mail.gmail.com>
next in thread | previous in thread | raw e-mail | index | archive | help
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--
Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?4D27785F.3040605>