Skip site navigation (1)Skip section navigation (2)
Date:      Sun, 9 Apr 1995 20:07:30 +1000
From:      Bruce Evans <bde@zeta.org.au>
To:        bde@zeta.org.au, rgrimes@gndrsh.aac.dev.com
Cc:        current@FreeBSD.org
Subject:   Re: sysconfig
Message-ID:  <199504091007.UAA13648@godzilla.zeta.org.au>

next 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
>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.

>...  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#^%%@%^.

>> 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.

Bruce



Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?199504091007.UAA13648>