From owner-freebsd-stable@FreeBSD.ORG Sun Aug 22 14:01:20 2010 Return-Path: Delivered-To: freebsd-stable@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id BFECE1065697 for ; Sun, 22 Aug 2010 14:01:20 +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 855A58FC14 for ; Sun, 22 Aug 2010 14:01:20 +0000 (UTC) Received: from turtle.stack.nl (turtle.stack.nl [IPv6:2001:610:1108:5010::132]) by mx1.stack.nl (Postfix) with ESMTP id A9ACE1DD607; Sun, 22 Aug 2010 16:01:18 +0200 (CEST) Received: by turtle.stack.nl (Postfix, from userid 1677) id 9CD431721D; Sun, 22 Aug 2010 16:01:18 +0200 (CEST) Date: Sun, 22 Aug 2010 16:01:18 +0200 From: Jilles Tjoelker To: Alexander Leidinger Message-ID: <20100822140118.GA42636@stack.nl> References: <4C6F5344.6040808@DataIX.net> <20100822150842.00005129@unknown> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <20100822150842.00005129@unknown> User-Agent: Mutt/1.5.20 (2009-06-14) Cc: jhell , FreeBSD Stable Subject: Re: daily run output 800.scrub-zfs fixups X-BeenThere: freebsd-stable@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: Production branch of FreeBSD source code List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sun, 22 Aug 2010 14:01:20 -0000 On Sun, Aug 22, 2010 at 03:08:42PM +0200, Alexander Leidinger wrote: > On Sat, 21 Aug 2010 00:17:08 -0400 jhell wrote: > > Hi Alexander, > > Attached is a fix for one problem and one slight overlook for > > 800.scrub-zfs. > > The first & second change was probably just an oversight but none the > > less they both give a false impression of actions taken. > > Change1: > > ${daily_scrub_zfs_default_threshold=30} is missng the ':' > > which would ultimately reset the users supplied value in > > periodic.conf to 30. > Sorry, but it is not missing the ':'. There is one in front of it. A > lot of start scripts in ports use this. You need to use a := instead of > a = if you use > var=${var:=default_val} > but not if you use > : ${var=default_val} > I have the impression that the ':' in front of the variable is the way > it is supposed to be in the start scripts in ports. I adopted this > style (one variable name less to type... specially with expressive > names this is some amount less to type). As described in sh(1) and POSIX, ${var=default_val} assigns the default if var was not set, while ${var:=default_val} assigns the default if var was not set or if it was set to the empty string. The double assignment in the construct var=${var:=default_val} is a workaround for bugs in very old Bourne shells (see Autoconf documentation for more). Our sh(1) has never had that bug, so simply : "${var:=default_val}" is better. The double-quotes prevent unnecessary pathname generation, which could be slow. However, even without the double-quotes, the correct value is assigned and no other side effects occur. > And I remember to have tested a lot of cases for the timeout value, > overriding a pool specific value and overriding the default where some > of them and all worked. > If you have a case where it does not work, it would be nice if you > could add a "set -x" in the beginning of the script and send me the > output of a failing run. -- Jilles Tjoelker