From owner-freebsd-rc@FreeBSD.ORG Fri Jan 6 15:17:42 2012 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 775EE106566B; Fri, 6 Jan 2012 15:17:42 +0000 (UTC) (envelope-from jilles@stack.nl) Received: from mx1.stack.nl (relay04.stack.nl [IPv6:2001:610:1108:5010::107]) by mx1.freebsd.org (Postfix) with ESMTP id 0B32F8FC08; Fri, 6 Jan 2012 15:17:42 +0000 (UTC) Received: from snail.stack.nl (snail.stack.nl [IPv6:2001:610:1108:5010::131]) by mx1.stack.nl (Postfix) with ESMTP id E452B1DD630; Fri, 6 Jan 2012 16:17:40 +0100 (CET) Received: by snail.stack.nl (Postfix, from userid 1677) id C9F6928468; Fri, 6 Jan 2012 16:17:40 +0100 (CET) Date: Fri, 6 Jan 2012 16:17:40 +0100 From: Jilles Tjoelker To: Pawel Jakub Dawidek Message-ID: <20120106151740.GA75037@stack.nl> References: <20120106141301.GE1693@garage.freebsd.pl> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <20120106141301.GE1693@garage.freebsd.pl> User-Agent: Mutt/1.5.21 (2010-09-15) Cc: freebsd-rc@FreeBSD.org Subject: Re: Making use of set_rcvar. 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: Fri, 06 Jan 2012 15:17:42 -0000 On Fri, Jan 06, 2012 at 03:13:03PM +0100, Pawel Jakub Dawidek wrote: > Any objections? > http://people.freebsd.org/~pjd/patches/set_rcvar.patch > This patch only changes scripts where set_rcvar can be used with no > arguments. While this makes the scripts cleaner, it will lead to extra forks with the current implementation of sh which will slow down boot to some extent. The effect is small on x86 but may be large on embedded platforms. If I could change history, I would have forbidden calling a function from a command substitution like that in the template. Instead, the function should be called normally and should set the variable itself. However, I think that cannot be changed anymore. I have a fairly small patch to sh to eliminate the fork when expanding $(set_rcvar). However, one could object that this does not add true new capabilities but only a new notation to the part of the language that executes without forks (because the function could write into a variable instead of being command-substituted). -- Jilles Tjoelker