On May 28, 5:48 ¨Βν¬ Άαςα®τ®θοχαςδΆ Όαςα®τ®θοχ®®®ΐηναιμ®γονΎ χςοτεΊ > On May 28, 2008, at 4:35 PM, Mike Kasick wrote: > > > Cute trick. > > > However, I wouldn't recommend it's use in any distributed code. > > flocks > > are intended to serve a purpose other than what's achieved as a side > > effect here, and although it's generally safe, the behavior is unknown > > at best if the script file resides in a remote file system like NFS. > > > For example, in Linux versions prior to 2.6.12 flocks are local > > only, so > > this would have the intended effect. ¨Βοχεφεςιξ Μιξυφεςσιοξσ ²®¶®±² > > and newer, flocks are emulated by POSIX locks, which should result in > > only a single instance running across a set of machines attempting to > > run the same script located in an NFS share. > > you can use the same trick even on NFS > > ¨Βερυιςε §ποσιψμογληειξσταμμποσιψμογλ > > ¨ΒΑΤΑ®ποσιψμογλ¨ ΖιμεΊΊΜΟΓΛίΕΖιμεΊΊΜΟΓΛίΞ> > and this will work for both NFS and local fs. ¨Βγουςσε ωου§ξεεδ το δεηςαδτο ζμογιζποσιψμογλιξοιξσταμμεδ®®®> > my lockfile gem is also NFS safe and can be used for this purpose. > actually it can make any program run one instance without modification > > rlock lockifle run_this_once.rb Good to know, thanks Ara. BTW, I don't see posixlock on the main codeforpeople file listing at http://rubyforge.org/frs/?group_id=1024 I was able to find 0.0.1 via the RAA, though. Is that the latest version? I ask because I want to build from source. Thanks, Dan