Skip site navigation (1)Skip section navigation (2)
Date:      Sat, 24 Dec 2011 16:00:01 -0700
From:      Warner Losh <imp@bsdimp.com>
To:        Maxim Ignatenko <gelraen.ua@gmail.com>
Cc:        freebsd-rc@freebsd.org
Subject:   Re: conf/163508: [rc.subr] [patch] Add &quot; enable&quot; and &quot; disable&quot; commands to rc.subr
Message-ID:  <D1ACDDF0-79C4-4873-910A-792978768FE7@bsdimp.com>
In-Reply-To: <CABWTX-Yy5sNsWdj%2B0CsOnf9uujW2GCwNxEFod5rz-sXGSo1Kig@mail.gmail.com>
References:  <201112241230.pBOCUF3h064098@freefall.freebsd.org> <CADLo83-SK%2Bo0b9GysjhH0N=TxsZXLRAuKL-n%2Btt6%2BCcr1gAJWQ@mail.gmail.com> <74F7E2CE-89DC-4F64-9A50-71B9FD458025@bsdimp.com> <CABWTX-Z71U2OVFt8mH2n7BVcKX9eYGnk9YWY7b53i-RQeMJKtA@mail.gmail.com> <D31DAF22-8941-4EAC-B05E-A860450F198E@bsdimp.com> <CABWTX-Yy5sNsWdj%2B0CsOnf9uujW2GCwNxEFod5rz-sXGSo1Kig@mail.gmail.com>

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

On Dec 24, 2011, at 11:04 AM, Maxim Ignatenko wrote:

> On 24 December 2011 19:51, Warner Losh <imp@bsdimp.com> wrote:
>>=20
>> On Dec 24, 2011, at 10:29 AM, Maxim Ignatenko wrote:
>>=20
>>>>  If the 5% of cases are when someone has done something complicated =
to the rc.conf file, then I don't care: they won't use this interface =
and we can detect this case and do nothing.
>>>=20
>>> Now I don't see how to distinguish cases when ${rcvar} set to =
default
>>> value in rc-script and when it's set in other file in some not =
obvious
>>> way.
>>=20
>> What does that matter?
>>=20
>=20
> In second case it should say something like "Unable to find where
> ${rcvar} was set". Now it adds ${rcvar}=3DYES to last included file in
> both cases. This still should correctly enable or disable some service
> unless /etc/rc.subr was modified to include some another file later,
> but, as I understood, this is what was meant by "corner case
> handling".

I don't see that as a problem.  If you're turning it on, then the fact =
that 'on' is default isn't really germane.  You've set it to 'on'.  To =
detect if it is set or not, you can look at the user file vs user file + =
defaults.

I'm not seeing what I'd call a hard problem here at all.

Warner




Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?D1ACDDF0-79C4-4873-910A-792978768FE7>