From owner-freebsd-rc@FreeBSD.ORG Mon Dec 26 17:27: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 7F491106566B; Mon, 26 Dec 2011 17:27:08 +0000 (UTC) (envelope-from gelraen.ua@gmail.com) Received: from mail-vw0-f54.google.com (mail-vw0-f54.google.com [209.85.212.54]) by mx1.freebsd.org (Postfix) with ESMTP id 1883E8FC19; Mon, 26 Dec 2011 17:27:07 +0000 (UTC) Received: by vbbfr13 with SMTP id fr13so15223998vbb.13 for ; Mon, 26 Dec 2011 09:27:07 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=gamma; h=mime-version:in-reply-to:references:from:date:message-id:subject:to :cc:content-type:content-transfer-encoding; bh=khMGsYu993dixmZF0SnSNWOdcwYCTrFSjvJVhZENMg0=; b=n0V2UZCpT3vOAQtnF3fdjKTCOcz+DXE9GeeZYxb027Cz5IxP/2XNzardiK4Gh8OD8X LztooFb3eWIXaoAb37uRhLERXHTY3Q+Etf4KiZug0Z+RKS66yhz7rnGIBjysGBEZtXgs 4iqBGoYcbbdEsi2/DEFA7G2S7xbePe0bj8vFY= Received: by 10.52.177.38 with SMTP id cn6mr12232128vdc.8.1324920427338; Mon, 26 Dec 2011 09:27:07 -0800 (PST) MIME-Version: 1.0 Received: by 10.52.29.225 with HTTP; Mon, 26 Dec 2011 09:26:46 -0800 (PST) In-Reply-To: <4EF8105D.3030907@FreeBSD.org> References: <201112241230.pBOCUF3h064098@freefall.freebsd.org> <4EF64915.4030006@FreeBSD.org> <4EF8105D.3030907@FreeBSD.org> From: Maxim Ignatenko Date: Mon, 26 Dec 2011 19:26:46 +0200 Message-ID: To: Doug Barton Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: quoted-printable 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: Mon, 26 Dec 2011 17:27:08 -0000 On 26 December 2011 08:12, Doug Barton wrote: > On 12/24/2011 15:08, Warner Losh wrote: >> >> On Dec 24, 2011, at 2:50 PM, Doug Barton wrote: >> >>> On 12/24/2011 08:46, Warner Losh wrote: >>>> Also, let's not reject =C2=A0it before it is done. =C2=A0Let's reject = it >>>> when it actually doesn't handle the cases that are interesting. >>>> No sense in cutting off a good feature because of some >>>> theoretical problem. =C2=A0It is a problem we have sometimes in the >>>> project... >>> >>> Warner, >>> >>> You seemed to have missed the bit where I said, "We've already been >>> down this path once before, and it turns out to be way harder to do >>> this right than it looks at first glance." >> >> No, I get that totally. =C2=A0I just don't care. =C2=A0The fact that oth= ers >> have failed shouldn't mean we should discourage others from trying. >> We shouldn't be shooting arrows at people before they are given a >> chance to produce something good or bad, or when they do shooting >> them without evaluating their work. > > You do get that the OP included a patch, right? > >>> Just as an example of potential problems, imagine a scenario where >>> the user has foo_enable=3DNO in rc.conf, but the service keeps >>> starting up anyway. >> >> Most people call that a bug, or at least POLA. =C2=A0The few cases in th= e >> tree where bar_enable=3Dyes forces foo_enable=3Dyes can be dealt with. > > No, you seem to be missing my point. Because of the way that rc.d > processes the various *conf* options the last match "wins." So let's say > that you had foo_enable=3D0 in /etc/rc.conf; but one of the conf files > that's processed later has foo_enable=3D1. If that's the last match, it > gets started. This is one of the many concerns regarding trying to > automatically enable or disable things. > Proposed patch searches all files (except /etc/defaults/rc.conf) that are included by load_rc_config() in _reverse_ order, so even if there are some other files included in rc.conf, foo_enable=3DNO gets added to the end of last processed file and we still have foo enabled.