From owner-freebsd-current@FreeBSD.ORG Sun Jul 25 14:11:04 2004 Return-Path: Delivered-To: freebsd-current@freebsd.org Received: from mx1.FreeBSD.org (mx1.freebsd.org [216.136.204.125]) by hub.freebsd.org (Postfix) with ESMTP id 0F85D16A4CE; Sun, 25 Jul 2004 14:11:04 +0000 (GMT) Received: from telecom.net.et (ns2.telecom.net.et [213.55.64.38]) by mx1.FreeBSD.org (Postfix) with ESMTP id 4ABEC43D31; Sun, 25 Jul 2004 14:11:01 +0000 (GMT) (envelope-from mtm@identd.net) Received: from [213.55.66.167] (HELO pool-151-200-10-97.res.east.verizon.net) by telecom.net.et (CommuniGate Pro SMTP 3.4.8) with ESMTP-TLS id 52575818; Sun, 25 Jul 2004 17:04:20 +0300 Received: from rogue.acs-et.com (localhost [127.0.0.1]) ESMTP id i6PEC99M028360; Sun, 25 Jul 2004 17:12:10 +0300 (EAT) (envelope-from mtm@rogue.acs-et.com) Received: (from mtm@localhost) by rogue.acs-et.com (8.12.11/8.12.11/Submit) id i6PEC9XN028359; Sun, 25 Jul 2004 17:12:09 +0300 (EAT) (envelope-from mtm) Date: Sun, 25 Jul 2004 17:12:08 +0300 From: Mike Makonnen To: freebsd-current@freebsd.org Message-ID: <20040725141208.GA28326@rogue.acs-et.com> Mime-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline User-Agent: Mutt/1.4.2.1i X-Operating-System: FreeBSD/5.2-CURRENT (i386) cc: freebsd-ports@freebsd.org Subject: Re: HEADS UP: change in ports rc.d script behaviour X-BeenThere: freebsd-current@freebsd.org X-Mailman-Version: 2.1.1 Precedence: list List-Id: Discussions about the use of FreeBSD-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sun, 25 Jul 2004 14:11:04 -0000 In the initial mail I post some tips on fixing ports rc.d scripts: 1. Use a return statement instead of exit in a '*.sh' script 2. Put the entire current contents of the script in a function and then execute that function in a subshell. For example: foo_script() { does something. } ( foo_script $*) 3. Install the script without a '.sh' ending I'd like to add one more to the following: 4. If you must include a default value for an rc.conf(5) knob, make sure that you put it in an if [ -z "$foo_knob"] clause. This is the reason the www/apache13 scripts are broken. There is a default value of apache_enable=no and apache_flags that overrides the user's setting in /etc/rc.conf, thus preventing apache from starting at all. Additionally, any users that don't want to deal with the possible breakage this commit may cause their system should either not run mergemaster (8) or if you do reject the changes to rc.d/localpkg until the ports you are worried about are fixed. Cheers. -- Mike Makonnen | GPG-KEY: http://www.identd.net/~mtm/mtm.asc mtm@identd.net | Fingerprint: AC7B 5672 2D11 F4D0 EBF8 5279 5359 2B82 7CD4 1F55 mtm@FreeBSD.Org| FreeBSD - Unleash the Daemon !