conf/163508: [rc.subr] [patch] Add " enable" and " disable" commands to rc.subr

Warner Losh imp at bsdimp.com
Sat Dec 24 23:00:08 UTC 2011


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

> On 24 December 2011 19:51, Warner Losh <imp at bsdimp.com> wrote:
>> 
>> On Dec 24, 2011, at 10:29 AM, Maxim Ignatenko wrote:
>> 
>>>>  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.
>>> 
>>> 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.
>> 
>> What does that matter?
>> 
> 
> In second case it should say something like "Unable to find where
> ${rcvar} was set". Now it adds ${rcvar}=YES 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



More information about the freebsd-rc mailing list