From owner-freebsd-rc@FreeBSD.ORG Thu Dec 28 00:23:47 2006 Return-Path: X-Original-To: freebsd-rc@freebsd.org Delivered-To: freebsd-rc@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [69.147.83.52]) by hub.freebsd.org (Postfix) with ESMTP id 0CB6116A407 for ; Thu, 28 Dec 2006 00:23:47 +0000 (UTC) (envelope-from dougb@FreeBSD.org) Received: from mail2.fluidhosting.com (mx21.fluidhosting.com [204.14.89.4]) by mx1.freebsd.org (Postfix) with SMTP id A494213C478 for ; Thu, 28 Dec 2006 00:23:46 +0000 (UTC) (envelope-from dougb@FreeBSD.org) Received: (qmail 21944 invoked by uid 399); 27 Dec 2006 23:57:06 -0000 Received: from localhost (HELO ?192.168.0.5?) (dougb@dougbarton.us@127.0.0.1) by localhost with SMTP; 27 Dec 2006 23:57:06 -0000 X-Originating-IP: 127.0.0.1 Message-ID: <45930850.4070906@FreeBSD.org> Date: Wed, 27 Dec 2006 15:57:04 -0800 From: Doug Barton Organization: http://www.freebsd.org/ User-Agent: Thunderbird 1.5.0.8 (X11/20061215) MIME-Version: 1.0 To: Yar Tikhiy References: <20061227105630.GB21493@comp.chem.msu.su> In-Reply-To: <20061227105630.GB21493@comp.chem.msu.su> X-Enigmail-Version: 0.94.1.0 Content-Type: text/plain; charset=ISO-8859-1 Content-Transfer-Encoding: 7bit Cc: freebsd-rc@freebsd.org Subject: Re: rc.d namespace 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: Thu, 28 Dec 2006 00:23:47 -0000 Yar Tikhiy wrote: > Hi folks, > > My attention has been drawn by the fact that rc.subr and rc.d/* > don't seem to follow uniform namespace rules. In general I'm in favor of consistency, but could you be more specific about what problem you're trying to solve? > Namely both rc.subr > and rc.d use global identifiers starting with an underscore. > Fortunately, rc.subr doesn't seem to use global identifiers not > starting with an underscore besides the names exported to scripts > on purpose. That's good news. > What do you think about adopting the following rule: "_foo" names > are for the rc.subr internals while just "foo" names are for rc.d > scripts? That works for me, especially if we don't have to make a lot of gratuitous changes to rc.subr. I would like to minimize the pain of adopting any new stuff from NetBSD if possible. > Another possible way is: __foo or even __rc_foo for > rc.subr, _foo for scripts, foo for the documented rc.subr interface. Personally I think that's too much drama. Since they are executed in a subshell, I don't really see a need for variables in individual rc.d scripts to be so careful about their namespace that they need something like _foo to start with, so I'd rather "enforce" this for the scripts than make radical changes to rc.d itself. Doug -- This .signature sanitized for your protection