From owner-freebsd-hackers Wed Apr 23 11:49:22 1997 Return-Path: Received: (from root@localhost) by hub.freebsd.org (8.8.5/8.8.5) id LAA16405 for hackers-outgoing; Wed, 23 Apr 1997 11:49:22 -0700 (PDT) Received: from shrimp.dataplex.net (shrimp.dataplex.net [208.2.87.3]) by hub.freebsd.org (8.8.5/8.8.5) with ESMTP id LAA16395 for ; Wed, 23 Apr 1997 11:49:16 -0700 (PDT) Received: from [204.69.236.50] (GATEWAY.SKIPSTONE.COM [198.214.10.129]) by shrimp.dataplex.net (8.8.5/8.8.5) with SMTP id NAA05426; Wed, 23 Apr 1997 13:48:31 -0500 (CDT) Date: 23 Apr 97 13:48:52 -0500 Subject: Re: /etc/netstart bogons.. From: "Richard Wackerbarth" To: "Jordan K. Hubbard" Cc: hackers@freebsd.org X-Mailer: Cyberdog/2.0 MIME-Version: 1.0 Message-Id: Content-Type: text/plain; charset=US-ASCII Content-Transfer-Encoding: 7bit Sender: owner-hackers@freebsd.org X-Loop: FreeBSD.org Precedence: bulk On Wed, Apr 23, 1997 1:05 PM, Jordan K. Hubbard wrote: >In /etc/netstart (and elsewhere) we have constructs of the form: > >if [ "x$gateway" != "xNO" ]; then > echo 'configuring host as a gateway.' > sysctl -w net.inet.ip.forwarding=1 >/dev/null 2>&1 >fi > >if [ "x$router" != "xNO" ] ; then > echo -n starting routing daemon: > echo -n " ${router}"; ${router} ${routerflags} > echo '.' >fi > >if [ "x$ipxgateway" != "xNO" ]; then >... > >And so on. This is, needless to say, DEEPLY DEEPLY EVIL since it will >cause these features to be turned on in the _absence_ of any such flag >setting, say because you have an old /etc/sysconfig file. You make >the world and you copy your new /etc files over (or this is done by >"upgrade") and having missed the new variables in sysconfig, you're >now quite surprised to see that you're running IPX and your machine >now considers itself a gateway. :-) > >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.. WRT "gateway", I agree the default (missing) should be NO. However, "router" is more complicated because they use the variable to indicate WHICH router to start. Therefore the test needs to be null or "NO" -> no router otherwise start the designated router.