Date: Sun, 25 Jul 2004 17:12:08 +0300 From: Mike Makonnen <mtm@identd.net> To: freebsd-current@freebsd.org Cc: freebsd-ports@freebsd.org Subject: Re: HEADS UP: change in ports rc.d script behaviour Message-ID: <20040725141208.GA28326@rogue.acs-et.com>
index | next in thread | raw e-mail
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 !
help
Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?20040725141208.GA28326>
