HAST + ZFS + NFS + CARP

Borja Marcos borjam at sarenet.es
Fri Aug 19 07:56:24 UTC 2016


> On 18 Aug 2016, at 15:29, Kevin P. Neal <kpn at neutralgood.org> wrote:
> 
> On Thu, Aug 18, 2016 at 08:36:24AM +0100, krad wrote:
>> I didnt think touch was atomic, mkdir is though
> 
> 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.
> 
> The better solution is to use FreeBSD's lockf command.

Unfortunately it’s not portable. Hence mkdir is the suggested way you will find on scripting
tutorials, especially the classic ones :)






Borja.



More information about the freebsd-fs mailing list