From owner-freebsd-fs@freebsd.org Fri Aug 19 07:56:24 2016 Return-Path: Delivered-To: freebsd-fs@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 4EFFBBBF4AB for ; Fri, 19 Aug 2016 07:56:24 +0000 (UTC) (envelope-from borjam@sarenet.es) Received: from cu01176b.smtpx.saremail.com (cu01176b.smtpx.saremail.com [195.16.151.151]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id 12DF4120C for ; Fri, 19 Aug 2016 07:56:23 +0000 (UTC) (envelope-from borjam@sarenet.es) Received: from [172.16.8.36] (izaro.sarenet.es [192.148.167.11]) by proxypop01.sare.net (Postfix) with ESMTPSA id 2A04B9DD34F; Fri, 19 Aug 2016 09:56:19 +0200 (CEST) Content-Type: text/plain; charset=utf-8 Mime-Version: 1.0 (Mac OS X Mail 9.3 \(3124\)) Subject: Re: HAST + ZFS + NFS + CARP From: Borja Marcos In-Reply-To: <20160818132948.GB51561@neutralgood.org> Date: Fri, 19 Aug 2016 09:56:19 +0200 Cc: krad , FreeBSD FS , InterNetX - Juergen Gotteswinter Content-Transfer-Encoding: quoted-printable Message-Id: <0B420CCC-D04F-451A-960B-496F9F0031AE@sarenet.es> References: <1AA52221-9B04-4CF6-97A3-D2C2B330B7F9@sarenet.es> <472bc879-977f-8c4c-c91a-84cc61efcd86@internetx.com> <20160817085413.GE22506@mordor.lan> <465bdec5-45b7-8a1d-d580-329ab6d4881b@internetx.com> <20160817095222.GG22506@mordor.lan> <52d5b687-1351-9ec5-7b67-bfa0be1c8415@kateley.com> <92F4BE3D-E4C1-4E5C-B631-D8F124988A83@gmail.com> <6b866b6e-1ab3-bcc5-151b-653e401742bd@kateley.com> <7468cc18-85e8-3765-2b2b-a93ef73ca05a@internetx.com> <20160818132948.GB51561@neutralgood.org> To: "Kevin P. Neal" X-Mailer: Apple Mail (2.3124) X-BeenThere: freebsd-fs@freebsd.org X-Mailman-Version: 2.1.22 Precedence: list List-Id: Filesystems List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Fri, 19 Aug 2016 07:56:24 -0000 > On 18 Aug 2016, at 15:29, Kevin P. Neal wrote: >=20 > On Thu, Aug 18, 2016 at 08:36:24AM +0100, krad wrote: >> I didnt think touch was atomic, mkdir is though >=20 > The shell script snippit that was posted is not safe since there is = time > in between the touch and the check for the existance of the lock file. >=20 > The better solution is to use FreeBSD's lockf command. Unfortunately it=E2=80=99s not portable. Hence mkdir is the suggested = way you will find on scripting tutorials, especially the classic ones :) Borja.