Skip site navigation (1)Skip section navigation (2)
Date:      Fri, 19 Aug 2016 09:56:19 +0200
From:      Borja Marcos <borjam@sarenet.es>
To:        "Kevin P. Neal" <kpn@neutralgood.org>
Cc:        krad <kraduk@gmail.com>, FreeBSD FS <freebsd-fs@freebsd.org>, InterNetX - Juergen Gotteswinter <juergen.gotteswinter@internetx.com>
Subject:   Re: HAST + ZFS + NFS + CARP
Message-ID:  <0B420CCC-D04F-451A-960B-496F9F0031AE@sarenet.es>
In-Reply-To: <20160818132948.GB51561@neutralgood.org>
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> <CALfReydFhMfFpQ1v6F8nv5a-UN-EnY5ipYe_oe_edYJfBzjXVQ@mail.gmail.com> <20160818132948.GB51561@neutralgood.org>

next in thread | previous in thread | raw e-mail | index | archive | help

> On 18 Aug 2016, at 15:29, Kevin P. Neal <kpn@neutralgood.org> 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.




Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?0B420CCC-D04F-451A-960B-496F9F0031AE>