Date: Thu, 05 Aug 2010 12:25:26 +0900 (JST) From: Hiroki Sato <hrs@FreeBSD.org> To: ports@FreeBSD.org Subject: :${foo_enable:=NO} in rc.d script Message-ID: <20100805.122526.70823211.hrs@allbsd.org>
next in thread | raw e-mail | index | archive | help
----Security_Multipart(Thu_Aug__5_12_25_26_2010_092)-- Content-Type: Text/Plain; charset=us-ascii Content-Transfer-Encoding: 7bit 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 ----Security_Multipart(Thu_Aug__5_12_25_26_2010_092)-- Content-Type: application/pgp-signature Content-Transfer-Encoding: 7bit -----BEGIN PGP SIGNATURE----- Version: GnuPG v1.4.9 (FreeBSD) iEYEABECAAYFAkxaLyYACgkQTyzT2CeTzy262QCaAgUN9sXeobhyqHNM0M1awTDc 1ZUAoMlLTdY60j48efrOu7aV7CqGaU/T =iEVh -----END PGP SIGNATURE----- ----Security_Multipart(Thu_Aug__5_12_25_26_2010_092)----
Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?20100805.122526.70823211.hrs>