From owner-freebsd-current Sun Apr 9 08:10:51 1995 Return-Path: current-owner Received: (from majordom@localhost) by freefall.cdrom.com (8.6.10/8.6.6) id IAA24048 for current-outgoing; Sun, 9 Apr 1995 08:10:51 -0700 Received: from gndrsh.aac.dev.com (gndrsh.aac.dev.com [198.145.92.241]) by freefall.cdrom.com (8.6.10/8.6.6) with ESMTP id IAA24040 for ; Sun, 9 Apr 1995 08:10:47 -0700 Received: (from rgrimes@localhost) by gndrsh.aac.dev.com (8.6.8/8.6.6) id IAA18689; Sun, 9 Apr 1995 08:06:09 -0700 From: "Rodney W. Grimes" Message-Id: <199504091506.IAA18689@gndrsh.aac.dev.com> Subject: Re: sysconfig To: bde@zeta.org.au (Bruce Evans) Date: Sun, 9 Apr 1995 08:06:09 -0700 (PDT) Cc: bde@zeta.org.au, current@FreeBSD.org In-Reply-To: <199504091007.UAA13648@godzilla.zeta.org.au> from "Bruce Evans" at Apr 9, 95 08:07:30 pm X-Mailer: ELM [version 2.4 PL23] Content-Type: text Content-Length: 2732 Sender: current-owner@FreeBSD.org Precedence: bulk > > >> I've noticed a problem with the way sysconfig is used: netstart, (etc.) > >> doesn't source it directly, so netstart only work when sourced from rc. > >> netstart should probably source sysconfig for itself and be run by `sh' > >> instead of `.' from rc. > > >Here is my fix for this: > >Add this to the start of /etc/netstart: > > ># If there is a global system configuration file, suck it in. > ># This may have already been done by /etc/rc, but since this > ># script can run standalone (often done when single user) we > ># need to do it again here [See below, the above 3 lines are now dead] > >if [ -f /etc/sysconfig ]; then > > . /etc/sysconfig > >fi > > > >I see no real reason to change /etc/rc, as sourcing /etc/sysconfig twice > >will not hurt us in anyway. It also would allow for /etc/netstart to > >create values and have them appear in /etc/rc if they are needed later. > > I'd still like to change it. It would allow removing lots of stupid > comments about ${foobar} being imported from sysconfig. The > configuration is easier to understand if all the global variables are > initialized in ONE place. Okay, I will grant you that. Changes are: /etc/rc: . /etc/netstart becomes sh /etc/netstart /etc/netstart: remove my comment about /etc/sysconfig already being sucked in by /etc/rc. [See above] I was going to make a second pass over the rc file stuff to clean up the comments about this and that being set in the sysconfig file. I don't like to mix functional change with cosmetic change. > >... There is still one more problem, /etc/netstart > >can't find the route binary becuase the PATH does not have /sbin on it > >when booted single user for some reason. > > >I will fix this RSN. > > Thanks, I often boot with -s and type fsck\n#^%%@%^. Your not the only one!!! > >> it is also bogus because > >> netstart is installed with perms 644. > > >It has been that way for a long time, the reasoning (as I understand it) was > >that with /etc in your path (no longer true) if you typed netstart on > >accident, it would go off and happily try to start the networking code. > >It can still occur with . in your path if you happen to be sitting in > >/etc. > > >This also applies to /etc/sysconfig, /etc/rc, /etc/rc.i386, and /etc/security. > >I see no real reason to change it, if you really want them to run > >sh filename or . filename is easy enough. > > 644 permissions are fine. The new files shouldn't start with #!/bin/sh. > /etc/rc doesn't. Okay, I'll kill the #!/bin/sh in yet another pass through /etc.... -- Rod Grimes rgrimes@gndrsh.aac.dev.com Accurate Automation Company Custom computers for FreeBSD