From owner-freebsd-rc@FreeBSD.ORG Sat Nov 5 11:35:11 2005 Return-Path: X-Original-To: freebsd-rc@freebsd.org Delivered-To: freebsd-rc@freebsd.org Received: from mx1.FreeBSD.org (mx1.freebsd.org [216.136.204.125]) by hub.freebsd.org (Postfix) with ESMTP id 5D89516A41F; Sat, 5 Nov 2005 11:35:11 +0000 (GMT) (envelope-from yar@comp.chem.msu.su) Received: from comp.chem.msu.su (comp.chem.msu.su [158.250.32.97]) by mx1.FreeBSD.org (Postfix) with ESMTP id 79C9B43D46; Sat, 5 Nov 2005 11:35:10 +0000 (GMT) (envelope-from yar@comp.chem.msu.su) Received: from comp.chem.msu.su (localhost [127.0.0.1]) by comp.chem.msu.su (8.13.3/8.13.3) with ESMTP id jA5BZ411014625; Sat, 5 Nov 2005 14:35:04 +0300 (MSK) (envelope-from yar@comp.chem.msu.su) Received: (from yar@localhost) by comp.chem.msu.su (8.13.3/8.13.3/Submit) id jA5BZ3TU014624; Sat, 5 Nov 2005 14:35:03 +0300 (MSK) (envelope-from yar) Date: Sat, 5 Nov 2005 14:35:03 +0300 From: Yar Tikhiy To: Maksim Yevmenkin Message-ID: <20051105113503.GA13863@comp.chem.msu.su> References: <4357CEA5.1000308@savvis.net> <4357D9E2.6010701@ebs.gr> <4367E346.4080106@savvis.net> <20051102111709.GD2465@comp.chem.msu.su> <20051102161311.GA8499@odin.ac.hmc.edu> <43690365.60909@savvis.net> <20051102190655.GA3961@odin.ac.hmc.edu> <436A6649.7000602@savvis.net> <20051103203217.GA30685@odin.ac.hmc.edu> <436BE02D.2020404@savvis.net> Mime-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <436BE02D.2020404@savvis.net> User-Agent: Mutt/1.5.9i Cc: freebsd-bluetooth@freebsd.org, freebsd-rc@freebsd.org, Panagiotis Astithas Subject: Re: [RFC] rc.d integration for the bluetooth subsystem 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, 05 Nov 2005 11:35:11 -0000 On Fri, Nov 04, 2005 at 02:26:53PM -0800, Maksim Yevmenkin wrote: > All, > > please find next revision of bluetooth-rc stuff at > > http://people.freebsd.org/~emax/bluetooth-rc-1.diff.txt > > in this revision i have moved all bluetooth configuration files under > /etc/bluetooth. bluetooth.device.sample is now called 'default.conf' and > file that contain device specific overrides called '$dev.conf' (i.e. > 'ubt0.conf'). > > so, '/etc/rc.d/bluetooth start $dev' does the following > > 1) sets hardwired defaults (for backward compatibility) > > 2) reads up /etc/bluetooth/default.conf (if any) > > 3) reads up /etc/bluetooth/$dev.conf (if any) > > 4) starts the stack > > even though /etc/bluetooth/{default,$dev}.conf are not exactly shell > scripts they are still kinda like shell scripts :) these files should > follow sh(1) syntax to set the variable, comments etc. > > the parser in bluetooth_read_conf() is very simple and value of a > variable is still used in sh(1) eval. so one must be careful when > editing these files. What about simplifying the inner parser code even more: case "$_line" in ''|\#*) ;; *) if expr "$_line" : "[a-zA-Z0-9_]*="; then eval "${_namespace}${_line}" else ${logger} "Unable to parse line \"$_line\" in $_file" return 1 fi ;; esac BTW, couldn't just err() or warn() be used instead of ${logger}? And AFAIK stdin to a while loop can be redirected w/o enclosing the loop in braces. -- Yar