From owner-freebsd-hackers Thu Apr 24 11:54:27 1997 Return-Path: Received: (from root@localhost) by hub.freebsd.org (8.8.5/8.8.5) id LAA23911 for hackers-outgoing; Thu, 24 Apr 1997 11:54:27 -0700 (PDT) Received: from cynic.portal.ca (root@cynic.portal.ca [204.174.36.7]) by hub.freebsd.org (8.8.5/8.8.5) with ESMTP id LAA23906 for ; Thu, 24 Apr 1997 11:54:26 -0700 (PDT) Received: from localhost ([[UNIX: localhost]]) by cynic.portal.ca (8.8.5/8.8.5) with SMTP id LAA07261; Thu, 24 Apr 1997 11:54:15 -0700 (PDT) X-Authentication-Warning: cynic.portal.ca: cjs owned process doing -bs Date: Thu, 24 Apr 1997 11:54:15 -0700 (PDT) From: Curt Sampson To: Michael Smith cc: "Jordan K. Hubbard" , hackers@freebsd.org Subject: Re: /etc/netstart bogons.. In-Reply-To: <199704240036.KAA23544@genesis.atrad.adelaide.edu.au> Message-ID: MIME-Version: 1.0 Content-Type: TEXT/PLAIN; charset=US-ASCII Sender: owner-hackers@freebsd.org X-Loop: FreeBSD.org Precedence: bulk On Thu, 24 Apr 1997, Michael Smith wrote: > > Any objection to reversing the polarity on these various ifs? If > > there's no variable or it's not explicitly set to YES, the operation > > should fail. Speak now or hold your peace, please.. > > Make a call now as to whether empty counts as set or unset. NetBSD's > convention is that set-but-empty means to use the default value, > whatever that is. Not really, no. Setting the variable to "DEFAULT" means use the default value. Many of our variables are set to "NO" not to run the program, "DEFAULT" to use reasonable defaults, or a list of flags. Thus, having the variable set to "" or unset (they're the same thing in /bin/sh) means `run the program with no command line arguments.' We have other variables that simply turn things on or off, and these are set to just YES or NO as needed. As for using shell functions and passing program names and whatnot as parameters, there are enough special cases out there that this may not be worthwhile. Things like: if [ "$nfs_server" = YES ] && [ -r /etc/exports ]; then if [ "$mountd_flags" = DEFAULT ]; then mountd_flags="" fi rm -f /var/db/mountdtab echo -n > /var/db/mountdtab echo -n ' mountd'; mountd $mountd_flags if [ "$nfsd_flags" = DEFAULT ]; then nfsd_flags="-tun 4" fi echo -n ' nfsd'; nfsd $nfsd_flags nfs_locking=MAYBE fi cjs Curt Sampson cjs@portal.ca Info at http://www.portal.ca/ Internet Portal Services, Inc. Through infinite myst, software reverberates Vancouver, BC (604) 257-9400 In code possess'd of invisible folly.