Subject: misc/4887: /etc/rc.conf insistance on uppercase YES/NO is mildly irritating
To: None <>
From: John F. Woods <>
List: netbsd-bugs
Date: 01/25/1998 12:23:39
>Number:         4887
>Category:       misc
>Synopsis:       /etc/rc.conf insistance on uppercase YES/NO is mildly irritating
>Confidential:   no
>Severity:       non-critical
>Priority:       low
>Responsible:    misc-bug-people (Misc Bug People)
>State:          open
>Class:          change-request
>Submitter-Id:   net
>Arrival-Date:   Sun Jan 25 09:35:01 1998
>Originator:     John F. Woods
>Release:        NetBSD 1.3 release
System: NetBSD 1.3 NetBSD 1.3 (JFW) #0: Fri Jan 16 11:55:17 EST 1998 i386

	Portmap wasn't starting up on my system because I had entered
"portmap=yes" instead of "portmap=YES" in /etc/rc.conf.  Although the
documentation does say that it must be YES or NO, this is a very natural
mistake to make, especially if you're in a hurry, and it's fixable with so
little cost.  (My proposed fix assumes that "Yes" and "No" are relatively
unlikely and thus don't need to be handled.)

	Make the above mistake.  Reboot.  Wonder why RPC programs hang
during initialization.

	Change /etc/rc.subr as follows:

#	$NetBSD: rc.subr,v 1.2 1997/08/30 03:34:29 cjs Exp $
# functions used by various rc scripts

# Test $1 variable, and warn if not set to YES or NO.
checkyesno() {
	eval value=\$${1};
	if [ "$value" = YES -o "$value" = yes ]; then
		return 0;
		if [ "$value" != NO -a "$value" != no ]; then
			logger -s "WARNING: \$${1} is not set properly."
		return 1;