From owner-freebsd-rc@FreeBSD.ORG Sat Dec 24 23:00:08 2011 Return-Path: Delivered-To: freebsd-rc@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id CB229106566B; Sat, 24 Dec 2011 23:00:07 +0000 (UTC) (envelope-from imp@bsdimp.com) Received: from harmony.bsdimp.com (bsdimp.com [199.45.160.85]) by mx1.freebsd.org (Postfix) with ESMTP id 6D21F8FC12; Sat, 24 Dec 2011 23:00:07 +0000 (UTC) Received: from 63.imp.bsdimp.com (63.imp.bsdimp.com [10.0.0.63]) (authenticated bits=0) by harmony.bsdimp.com (8.14.4/8.14.3) with ESMTP id pBON01dc014175 (version=TLSv1/SSLv3 cipher=DHE-DSS-AES128-SHA bits=128 verify=NO); Sat, 24 Dec 2011 16:00:01 -0700 (MST) (envelope-from imp@bsdimp.com) Mime-Version: 1.0 (Apple Message framework v1084) Content-Type: text/plain; charset=us-ascii From: Warner Losh In-Reply-To: Date: Sat, 24 Dec 2011 16:00:01 -0700 Content-Transfer-Encoding: quoted-printable Message-Id: References: <201112241230.pBOCUF3h064098@freefall.freebsd.org> <74F7E2CE-89DC-4F64-9A50-71B9FD458025@bsdimp.com> To: Maxim Ignatenko X-Mailer: Apple Mail (2.1084) X-Greylist: Sender succeeded SMTP AUTH, not delayed by milter-greylist-4.0.1 (harmony.bsdimp.com [10.0.0.6]); Sat, 24 Dec 2011 16:00:02 -0700 (MST) Cc: freebsd-rc@freebsd.org Subject: Re: conf/163508: [rc.subr] [patch] Add " enable" and " disable" commands to rc.subr X-BeenThere: freebsd-rc@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: "Discussion related to /etc/rc.d design and implementation." List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sat, 24 Dec 2011 23:00:08 -0000 On Dec 24, 2011, at 11:04 AM, Maxim Ignatenko wrote: > On 24 December 2011 19:51, Warner Losh 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