:${foo_enable:=NO} in rc.d script
Hiroki Sato
hrs at FreeBSD.org
Thu Aug 5 03:27:37 UTC 2010
Hi,
This may be discussed already but I could not find which was correct,
so please point out it if we already have a consensus...
Well, I am wondering if an rc.d script installed by a port must have
": ${foo_enable:=NO}" line. An example in the porter's handbook
includes this, and I can understand it works fine. My question is
"this is really needed or not".
When $foo_enable is not defined, checkyesno() displays "WARNING:
$foo_enable is not set properly - see rc.conf(5)" and it is
interpreted as NO. I was thinking this message is useful for letting
people know which knob(s) should be configured by themselves after
the installation, but recently someone pointed out this was not
consistent and the default value should be defined as NO in the
script.
I can understand setting it as NO by default and allowing a user to
override YES/NO in rc.conf work fine and intuitive. However, is
there a case that the $foo_enable is set as YES by default? If not,
what is the reason why the warning is displayed instead of simply
thinking it as NO when $foo_enable is undefined?
My feeling is that 1) $foo_enable should be interpreted as NO if not
defined and a user should configure it (YES/NO) by herself after the
installation, and 2) other variables like $foo_flags or $foo_pidfile
should have their default values to allow the software be able to run
simply by adding a line foo_enable=YES into rc.conf.
While I do not have a strong opinion on 1), I am not sure if it is
the correct interpretation. Setting the variable as NO by default
will make the warning message disappear, but in that case it is
difficult for the user to find the knobs. And if it is equivalent to
NO when the variable is not defined, I don't understand what is the
advantage of setting it as NO explicitly by default.
Since most of ports I am maintaining do not have this line, I need to
fix them if setting the variable as NO consistently is preferable.
-- Hiroki
-------------- next part --------------
A non-text attachment was scrubbed...
Name: not available
Type: application/pgp-signature
Size: 195 bytes
Desc: not available
Url : http://lists.freebsd.org/pipermail/freebsd-ports/attachments/20100805/18582540/attachment.pgp
More information about the freebsd-ports
mailing list