Skip site navigation (1)Skip section navigation (2)
Date:      Mon, 25 Sep 2017 09:18:57 -0600
From:      Warner Losh <imp@bsdimp.com>
To:        Ian Lepore <ian@freebsd.org>
Cc:        "freebsd-arch@FreeBSD.org" <freebsd-arch@freebsd.org>
Subject:   Re: rc.d scripts and rc.conf variable defaults
Message-ID:  <CANCZdfqGHM6j5Go%2BJEhYa0wcWW2zSdbeiPhixNrp4ZAyqPR_uQ@mail.gmail.com>
In-Reply-To: <1506349681.73082.124.camel@freebsd.org>
References:  <1506349681.73082.124.camel@freebsd.org>

next in thread | previous in thread | raw e-mail | index | archive | help
On Mon, Sep 25, 2017 at 8:28 AM, Ian Lepore <ian@freebsd.org> wrote:

> We have about 165 scripts in etc/rc.d.  22 of them handle their own
> default values for configuration variables using ${var:=default} or
> ${var:-default}.  Presumably all the others rely on defaults/rc.conf
> providing the default values.
>
> Is there a standard, written or not, covering this?
>

When /etc/defaults/rc.conf was created, the standard was everything belongs
there to protect the user from default churn.


> rc.conf(5) says that defaults/rc.conf is the thing that includes your
> /etc/rc.conf, and that would certainly guarantee that the system-
> provided defaults are in place, but the current implementation doesn't
> actually work that way.  rc.subr is currently forgiving of a missing
> defaults file.
>

Yes, it was implemented that way a long time ago, but there was a switch to
a list of rc files to read at some point and the docs weren't updated.


> I'd prefer that the system rc.d scripts relied on defaults/rc.conf
> alone and individual rc.d scripts not be cluttered up with :- syntax.
>  While rc.conf(5) strongly implies the file is required, it doesn't
> exactly say so.  Should it?
>

IMHO, yes. It's certainly was the intent when this stuff was invented.

Warner



Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?CANCZdfqGHM6j5Go%2BJEhYa0wcWW2zSdbeiPhixNrp4ZAyqPR_uQ>