From owner-freebsd-ports@FreeBSD.ORG Sun Jan 24 06:50:21 2010 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 59E761065698 for ; Sun, 24 Jan 2010 06:50:21 +0000 (UTC) (envelope-from dougb@FreeBSD.org) Received: from mail2.fluidhosting.com (mx21.fluidhosting.com [204.14.89.4]) by mx1.freebsd.org (Postfix) with ESMTP id 01CCF8FC1B for ; Sun, 24 Jan 2010 06:50:20 +0000 (UTC) Received: (qmail 850 invoked by uid 399); 24 Jan 2010 06:50:20 -0000 Received: from localhost (HELO foreign.dougb.net) (dougb@dougbarton.us@127.0.0.1) by localhost with ESMTPAM; 24 Jan 2010 06:50:20 -0000 X-Originating-IP: 127.0.0.1 X-Sender: dougb@dougbarton.us Message-ID: <4B5BEDB1.8080308@FreeBSD.org> Date: Sat, 23 Jan 2010 22:50:25 -0800 From: Doug Barton Organization: http://SupersetSolutions.com/ User-Agent: Mozilla/5.0 (X11; U; FreeBSD i386; en-US; rv:1.9.1.7) Gecko/20100123 Thunderbird/3.0.1 MIME-Version: 1.0 To: =?ISO-8859-1?Q?Francisco_de_Borja_L=F3pez_R=EDo?= References: <20100120165147.666592ef.borja@pexego.es> <20100120212640.GE6618@lonesome.com> <7be7a2801001201600j5c772267na6dea944334618be@mail.gmail.com> <20100121093649.7867d810.borja@pexego.es> <20100121095114.12bab6af.borja@pexego.es> In-Reply-To: <20100121095114.12bab6af.borja@pexego.es> X-Enigmail-Version: 1.0 OpenPGP: id=D5B2F0FB Content-Type: text/plain; charset=ISO-8859-1 Content-Transfer-Encoding: 8bit Cc: ports@freebsd.org, wen heping Subject: Re: New port: finance/openerp-web 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: Sun, 24 Jan 2010 06:50:21 -0000 On 01/21/10 00:51, Francisco de Borja López Río wrote: > > Sorry, I forgot to add the attachments in my previous email. > > These are both the rc.d script and the default configuration file I've > been using with the current openerp-server port for some time. A few notes on the rc.d script. 1. The name of the file, PROVIDE, and $name should all match. Perhaps openerpd, or even erpd? 2. There are quite a few examples of "/usr/local" in there (which is fine for a running script), please remember to s#/usr/local#%%PREFIX%%#g for the port. 3. The pidfile= should come after load_rc_config, and should look like this: pidfile="${_pidfile:-/var/run/openerp-server/openerp-server.pid}" (substitute of course). Or, consider not allowing the user to change the location of the pidfile unless there is a good reason to do so. 4. I'm not quite sure what eval "${rcvar}=\${${rcvar}:-'NO'}" is supposed to accomplish, but if it's "set ${name}_enable to NO by default" it's too clever by half. :) Take a look at http://www.freebsd.org/doc/en_US.ISO8859-1/books/porters-handbook/rc-scripts.html for other ways to simplify the default variable assignments (as well as some other pointers). 5. Just doing 'touch foo' is always cheaper than testing its existence first (although it's a micro-optimization) and there is no reason to test existence anyway. Same goes with the 'mkdir -p'. 6. Instead of `dirname blah` you should use ${blah%/*} for two reasons, first dirname(1) is in /usr/bin, and may not be available at boot, and two there is no reason to use it in a shell script when the variable substitution is cheaper and easier. 7. You named your substitute stop_cmd "${name}_poststop" which is confusing, and I'm not sure why it's necessary. If you're afraid that rc.d isn't going to actually stop the process for some reason we should address that. If you feel that you absolutely must have a safety belt for this make it a real stop_postcmd. I realize that these are a lot of notes, but don't worry ... it's easy to see that a lot of thought and creativity went into this, which is why I'm taking the time to try and help improve it. Doug -- Improve the effectiveness of your Internet presence with a domain name makeover! http://SupersetSolutions.com/ Computers are useless. They can only give you answers. -- Pablo Picasso