Date: Sun, 9 Apr 1995 08:06:09 -0700 (PDT) From: "Rodney W. Grimes" <rgrimes@gndrsh.aac.dev.com> To: bde@zeta.org.au (Bruce Evans) Cc: bde@zeta.org.au, current@FreeBSD.org Subject: Re: sysconfig Message-ID: <199504091506.IAA18689@gndrsh.aac.dev.com> In-Reply-To: <199504091007.UAA13648@godzilla.zeta.org.au> from "Bruce Evans" at Apr 9, 95 08:07:30 pm
next in thread | previous in thread | raw e-mail | index | archive | help
> > >> 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
Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?199504091506.IAA18689>