Re: HEADS UP: change in ports rc.d script behaviour

From: Mike Makonnen <mtm_at_identd.net>
Date: Sun, 25 Jul 2004 17:12:08 +0300
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_at_identd.net | Fingerprint: AC7B 5672 2D11 F4D0 EBF8  5279 5359 2B82 7CD4 1F55
mtm_at_FreeBSD.Org| FreeBSD - Unleash the Daemon !
Received on Sun Jul 25 2004 - 12:11:04 UTC

This archive was generated by hypermail 2.4.0 : Wed May 19 2021 - 11:38:03 UTC