Bug 149250 - japanese/FreeWnn-server: /etc/rc: WARNING: $wnn_enable is not set properly - see rc.conf(5).
Summary: japanese/FreeWnn-server: /etc/rc: WARNING: $wnn_enable is not set properly - ...
Status: Closed FIXED
Alias: None
Product: Ports & Packages
Classification: Unclassified
Component: Individual Port(s) (show other bugs)
Version: Latest
Hardware: Any Any
: Normal Affects Only Me
Assignee: Hiroki Sato
URL:
Keywords:
Depends on:
Blocks:
 
Reported: 2010-08-03 21:50 UTC by Noritoshi Demizu
Modified: 2014-09-11 07:51 UTC (History)
1 user (show)

See Also:


Attachments
file.diff (185 bytes, patch)
2010-08-03 21:50 UTC, Noritoshi Demizu
no flags Details | Diff

Note You need to log in before you can comment on or make changes to this bug.
Description Noritoshi Demizu 2010-08-03 21:50:06 UTC
I installed ja-FreeWnn-server-1.1.1.a021_8 with some other ports software using sysinstall.
After they are installed successfuly, I rebooted the machine without modifying /etc/rc.conf.
(I don't remember the reason why I rebooted the machine.)

Then, I saw the following message.

  /etc/rc: WARNING: $wnn_enable is not set properly - see rc.conf(5).

After I added wnn_enable="YES" into /etc/rc.conf, the message disappeared.

But I think the message should not be shown when wnn_enable is not set in /etc/rc.conf
because I think the message makes people confused.

Fix: The attached patch fixes this problem.

Patch attached with submission follows:
How-To-Repeat: Install ja-FreeWnn-server-1.1.1.a021_8 from ports.
Then just reboot the machine.
Comment 1 Mark Linimon freebsd_committer freebsd_triage 2010-08-04 00:46:28 UTC
Responsible Changed
From-To: freebsd-ports-bugs->hrs

Fix synopsis and assign.
Comment 2 Hiroki Sato freebsd_committer freebsd_triage 2010-08-04 04:31:39 UTC
----Security_Multipart(Wed_Aug__4_12_31_39_2010_642)--
Content-Type: Text/Plain; charset=us-ascii
Content-Transfer-Encoding: 7bit

Noritoshi Demizu <demizu@dd.iij4u.or.jp> wrote
  in <201008032049.o73KnN3h065220@www.freebsd.org>:

de> I installed ja-FreeWnn-server-1.1.1.a021_8 with some other ports software using sysinstall.
de> After they are installed successfuly, I rebooted the machine without modifying /etc/rc.conf.
de> (I don't remember the reason why I rebooted the machine.)
de>
de> Then, I saw the following message.
de>
de>   /etc/rc: WARNING: $wnn_enable is not set properly - see rc.conf(5).
de>
de> After I added wnn_enable="YES" into /etc/rc.conf, the message disappeared.
de>
de> But I think the message should not be shown when wnn_enable is not set in /etc/rc.conf
de> because I think the message makes people confused.

 More specifics of how people confused?  This was rather intentional;
 IMHO this message is helpful for users to know what knob should be
 configured for enabling the software.  If setting it NO by default in
 some way, people cannot know how to enable it.

 While I can understand an idea that $foo_enable should be defined as
 YES or NO by default, it does not come from the reason that it is
 confusing unless doing so since the current one is equivalent to NO
 and the difference is only that a warning message is displayed.
 Please let me know if you have an example that causes people trouble.
 Thank you.

-- Hiroki

----Security_Multipart(Wed_Aug__4_12_31_39_2010_642)--
Content-Type: application/pgp-signature
Content-Transfer-Encoding: 7bit

-----BEGIN PGP SIGNATURE-----
Version: GnuPG v1.4.9 (FreeBSD)

iEYEABECAAYFAkxY3xsACgkQTyzT2CeTzy2WTgCfQNHCpLgS9rmEgPkuV8DKCEun
CTAAn3dJaYXrDGBemrtaMp0QXHq5Jr3N
=Ttql
-----END PGP SIGNATURE-----

----Security_Multipart(Wed_Aug__4_12_31_39_2010_642)----
Comment 3 Noritoshi Demizu 2010-08-04 20:23:09 UTC
> From: Hiroki Sato <hrs@FreeBSD.org>
> To: demizu@dd.iij4u.or.jp
> Cc: freebsd-gnats-submit@FreeBSD.org
> Subject: Re: ports/149250: /etc/rc: WARNING: $wnn_enable is not set properly - see rc.conf(5).
> Date: Wed, 04 Aug 2010 12:31:39 +0900 (JST)
>
> Noritoshi Demizu <demizu@dd.iij4u.or.jp> wrote
>   in <201008032049.o73KnN3h065220@www.freebsd.org>:
>
> de> I installed ja-FreeWnn-server-1.1.1.a021_8 with some other ports software using sysinstall.
> de> After they are installed successfuly, I rebooted the machine without modifying /etc/rc.conf.
> de> (I don't remember the reason why I rebooted the machine.)
> de>
> de> Then, I saw the following message.
> de>
> de>   /etc/rc: WARNING: $wnn_enable is not set properly - see rc.conf(5).
> de>
> de> After I added wnn_enable="YES" into /etc/rc.conf, the message disappeared.
> de>
> de> But I think the message should not be shown when wnn_enable is not set in /etc/rc.conf
> de> because I think the message makes people confused.
>
>  More specifics of how people confused?  This was rather intentional;
>  IMHO this message is helpful for users to know what knob should be
>  configured for enabling the software.  If setting it NO by default in
>  some way, people cannot know how to enable it.
>
>  While I can understand an idea that $foo_enable should be defined as
>  YES or NO by default, it does not come from the reason that it is
>  confusing unless doing so since the current one is equivalent to NO
>  and the difference is only that a warning message is displayed.
>  Please let me know if you have an example that causes people trouble.
>  Thank you.
>
> -- Hiroki

Thank you for your reply.

I am currently a FreeBSD 4.11R user.  I am writing this e-mail
on a FreeBSD 4.11R machine.  And now I am trying to switch to
FreeBSD 8.1R.  So, honestly, I am not familiar with recent
FreeBSD conventions.  I am sorry if my report was based on
my ignorance.

I have installed 355 package according to "ls /var/db/pkg | wc"
on my new FreeBSD 8.1R machine.  And I have five scripts under
/usr/local/etc/rc.d; dbus, git_daemon, hald, isc-dhcp and wnn.

If I comment out all of their ${name}_enable in /etc/rc.conf,
only one warning is printed out. i.e., the following message.

/etc/rc: WARNING: $wnn_enable is not set properly - see rc.conf(5).

For other four packages, no warning message is printed out.


I know that this warning message is printed out by checkyesno()
defined in /etc/rc.subr, whiched is called as "checkyesno ${rcvar}"
in run_rc_command().  And $rcvar is defined in each script under
/usr/local/etc/rc.d as rcvar=`set_rcvar`.  set_rcvar() is defined
in /etc/rc.subr and it returns ${name}_enable when no argument is
specified.

I checked five scripts under /usr/local/etc/rc.d on my machine,
and found four of them defins ${name}_enable as following.

  In /usr/local/etc/rc.d/dbus:
  dbus_enable=${dbus_enable-${gnome_enable}}

  In /usr/local/etc/rc.d/git_daemon:
  : ${git_daemon_enable:=NO}

  In /usr/local/etc/rc.d/hald:
  hald_enable=${hald_enable-${gnome_enable}}

  In /usr/local/etc/rc.d/isc-dhcpd:
  dhcpd_enable=${dhcpd_enable:-"NO"}

  Note: gnome_enable above is defined in /usr/local/etc/gnome.subr
  which is sourced by dbus and hald.


So, I guessed every scripts under /usr/local/etc/rc.d should have
${name}_enable.  I agree that the number of samples I checked is
too small.  I admit my guess was based on my limited experience.


When I saw the warning message yesterday night (or rather dawn),
it took some amount of time to figure out what happened to Wnn.
I wanted to make it sure whether adding "wnn_enable=YES" is the
right thing to do or it just hid other problem.  This is an example
of confusion.  But this question might come from my ignorance...


BTW, If wnn_enable is not defined intentionally, all other ${name}_enable
should also be removed, shouldn't they?  If dbus_enable and hald_enable
didn't have default value (i,e,. NO), it would be easier for me to
find out what to do to run X.  I think consistency makes it easier
to understand what is going on and to find out what to do.


To conclude, I agree the idea that the warning messages printed by
checkyesno() are helpful for users to find out which variables should
be set.  But, in that case, I still do not understand why some scripts
under /usr/local/etc/rc.d defines ${name}_enable while others not.
I think consistency also helps users.

Thank you
Noritoshi Demizu
Comment 4 Carlo Strub freebsd_committer freebsd_triage 2014-09-07 19:48:21 UTC
Is this PR still relevant?
Comment 5 commit-hook freebsd_committer freebsd_triage 2014-09-11 07:48:24 UTC
A commit references this bug:

Author: hrs
Date: Thu Sep 11 07:48:20 UTC 2014
New revision: 367909
URL: http://svnweb.freebsd.org/changeset/ports/367909

Log:
  - Fix a bug which prevented a bind(2) call from working.
  - Support "make stage" by a non-root user.
  - Set $*wnn_enable=NO by default. [*]
  - Fix pkg-plist.

  PR:	149250 [*]

Changes:
  head/chinese/FreeWnn-server/pkg-plist
  head/japanese/FreeWnn-lib/Makefile
  head/japanese/FreeWnn-lib/files/patch-Contrib-dic-gerodic-Makefile.in
  head/japanese/FreeWnn-lib/files/patch-Wnn-jserver-Makefile.in
  head/japanese/FreeWnn-lib/files/patch-Wnn-jserver-de.c
  head/japanese/FreeWnn-lib/files/patch-Wnn-jutil-Makefile.in
  head/japanese/FreeWnn-lib/files/patch-Wnn-pubdicplus-Makefile.in
  head/japanese/FreeWnn-lib/files/patch-Wnn-wnncons-dic-Makefile.in
  head/japanese/FreeWnn-lib/files/patch-Xwnmo-xjutil-Makefile.in
  head/japanese/FreeWnn-lib/files/patch-Xwnmo-xwnmo-Makefile.in
  head/japanese/FreeWnn-lib/files/patch-aclocal.m4
  head/japanese/FreeWnn-lib/files/patch-cWnn-cd-Makefile.in
  head/japanese/FreeWnn-lib/files/patch-cWnn-cdic-Makefile.in
  head/japanese/FreeWnn-lib/files/patch-cWnn-jserver-Makefile.in
  head/japanese/FreeWnn-lib/files/patch-cWnn-jutil-Makefile.in
  head/japanese/FreeWnn-lib/files/patch-cWnn-tdic-Makefile.in
  head/japanese/FreeWnn-lib/files/patch-config.h.in
  head/japanese/FreeWnn-lib/files/patch-configure
  head/japanese/FreeWnn-lib/files/patch-kWnn-jserver-Makefile.in
  head/japanese/FreeWnn-lib/files/patch-kWnn-jutil-Makefile.in
  head/japanese/FreeWnn-lib/files/patch-kWnn-kd-Makefile.in
  head/japanese/FreeWnn-lib/files/patch-kWnn-kdic-Makefile.in
  head/japanese/FreeWnn-lib/files/patch-ltmain.sh
  head/japanese/FreeWnn-server/Makefile
  head/japanese/FreeWnn-server/files/cwnn.in
  head/japanese/FreeWnn-server/files/kwnn.in
  head/japanese/FreeWnn-server/files/patch-Contrib-dic-gerodic-Makefile.in
  head/japanese/FreeWnn-server/files/patch-Wnn-jserver-Makefile.in
  head/japanese/FreeWnn-server/files/patch-Wnn-jserver-de.c
  head/japanese/FreeWnn-server/files/patch-Wnn-jutil-Makefile.in
  head/japanese/FreeWnn-server/files/patch-Wnn-pubdicplus-Makefile.in
  head/japanese/FreeWnn-server/files/patch-Wnn-wnncons-dic-Makefile.in
  head/japanese/FreeWnn-server/files/patch-Xwnmo-xjutil-Makefile.in
  head/japanese/FreeWnn-server/files/patch-Xwnmo-xwnmo-Makefile.in
  head/japanese/FreeWnn-server/files/patch-aclocal.m4
  head/japanese/FreeWnn-server/files/patch-cWnn-cd-Makefile.in
  head/japanese/FreeWnn-server/files/patch-cWnn-cdic-Makefile.in
  head/japanese/FreeWnn-server/files/patch-cWnn-jserver-Makefile.in
  head/japanese/FreeWnn-server/files/patch-cWnn-jutil-Makefile.in
  head/japanese/FreeWnn-server/files/patch-cWnn-tdic-Makefile.in
  head/japanese/FreeWnn-server/files/patch-config.h.in
  head/japanese/FreeWnn-server/files/patch-configure
  head/japanese/FreeWnn-server/files/patch-kWnn-jserver-Makefile.in
  head/japanese/FreeWnn-server/files/patch-kWnn-jutil-Makefile.in
  head/japanese/FreeWnn-server/files/patch-kWnn-kd-Makefile.in
  head/japanese/FreeWnn-server/files/patch-kWnn-kdic-Makefile.in
  head/japanese/FreeWnn-server/files/patch-ltmain.sh
  head/japanese/FreeWnn-server/files/patch-makerule.mk.in
  head/japanese/FreeWnn-server/files/twnn.in
  head/japanese/FreeWnn-server/files/wnn.in
  head/korean/FreeWnn-server/pkg-plist
Comment 6 Hiroki Sato freebsd_committer freebsd_triage 2014-09-11 07:51:20 UTC
Committed a change to set the default value since we now have it consistently in the ports tree.