Skip site navigation (1)Skip section navigation (2)
Date:      Thu, 18 Oct 2001 10:52:50 +0200
From:      "Patrick O'Reilly" <patrick@mip.co.za>
To:        "Alan Char" <alanchar@meer.net>, <edwin@mavetju.org>
Cc:        <questions@FreeBSD.ORG>, <support@FreeBSD.ORG>
Subject:   RE: upgrading and /etc/rc
Message-ID:  <NDBBIMKICMDGDMNOOCAICEGNDLAA.patrick@mip.co.za>
In-Reply-To: <200110180700.f9I70rf03272@localhost.meer.net>

next in thread | previous in thread | raw e-mail | index | archive | help
Alan,

> Sorting shell scripts, even if they are just settings, seems
> like a bad policy decision in general.
Edwin has made the point: /etc/rc.conf is NOT a shell script, it is a
collection of settings.

I agree that it messes with comments, so what I do is something like this:
----------------------------------
sendmail_enable="YES"      # Enable the sendmail daemon
named_enable="NO"          # DNS is running on 'apollo'
inetd_enable="YES"         # I need this to kick ftpd
----------------------------------

This way the sort simply results in:
----------------------------------
inetd_enable="YES"         # I need this to kick ftpd
named_enable="NO"          # DNS is running on 'apollo'
sendmail_enable="YES"      # Enable the sendmail daemon
----------------------------------

One ADVANTAGE of sorting it is that you will quickly see when you have a
duplicated entry (this little problem has caused me numerous grey hairs in
the past!).
If you have:
----------------------------------
sendmail_enable="YES"      # Enable the sendmail daemon
named_enable="NO"          # DNS is running on 'apollo'
inetd_enable="YES"         # I need this to kick ftpd
# Other lines here
sendmail_enable="NO"       # Disable during (whatever)
----------------------------------
you might pull your hair out (actually, that's what I did!  I'm going bald,
not grey!) trying to figure out why sendmail won't start during boot,
because whenever you look at rc.conf you (human) see the first line which
says its enabled, but fail to notice the later line which some careless
sysadmin left lying around!  After sorting you have:
----------------------------------
# Other lines here
inetd_enable="YES"         # I need this to kick ftpd
named_enable="NO"          # DNS is running on 'apollo'
sendmail_enable="NO"       # Disable during (whatever)
sendmail_enable="YES"      # Enable the sendmail daemon
----------------------------------
and now it is obvious even at a casual glance that you have an anomoly to
sort out.

Patrick.

> Hi.  Thanks for the flip response.  My /etc/rc.conf has apparently been
> inherited from older versions of FreeBSD since the installation process
> by default does not overwrite it (except, recently, to sort its contents).
> I have never edited /etc/rc.conf.  At any rate, even for comments, this
> is a really bad idea.  Sorting shell scripts, even if they are just
> settings, seems like a bad policy decision in general.  --Alan
>
>
>
> Edwin Groothuis wrote:
> > /etc/rc.conf should only be a configuration file, not a real script.
> > /etc/rc.local is run via /etc/rc. man rc.conf says:
> >
> >      The purpose of rc.conf is not to run commands or perform
> system startup
> >      actions directly.  Instead, it is included by the various
> generic startup
> >      scripts in /etc which conditionalize their internal
> actions according to
> >      the settings found there.
> >
> > So please don't :-)
> >
> > Edwin
>
>
> On Wed, Oct 17, 2001 at 10:01:44PM -0700, Alan Char wrote:
> > Hi.  I upgraded from 4.3 to 4.4 today, and somehow in the process,
> > the /etc/rc.conf file got sorted.  This also happened when I upgraded
> > from 4.2 to 4.3.  Unfortunately, /etc/rc.conf has a little if-block
> > at the end to run /etc/rc.local, and after it sorting it creates a
> > syntax error.  Doesn't do much for making comments useful, either.
> > Is there a way to turn off this "feature"?  Thanks.
>
>
> To Unsubscribe: send mail to majordomo@FreeBSD.org
> with "unsubscribe freebsd-questions" in the body of the message
>


To Unsubscribe: send mail to majordomo@FreeBSD.org
with "unsubscribe freebsd-questions" in the body of the message




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