Take the 2-minute tour ×
Unix & Linux Stack Exchange is a question and answer site for users of Linux, FreeBSD and other Un*x-like operating systems.. It's 100% free, no registration required.

Possible Duplicate:
What Unix commands can be used as a semaphore/lock?

I have read many similar post and the solution seems to be to use flock. flock does not exist on my system and I don't have rights to add it.

References:

  1. A "BashFAQ" link provided in a comment in how-to-make-sure-only-one-instance-of-a-bash-script-runs talks about using flock
share|improve this question
    
How about Perl? Besides, the lock directory solution is available. –  sr_ Jan 18 '13 at 15:00
    
@sr_ Yes I do have Perl! For portability I am hoping to avoid dependency on external programs.. –  Kent Pawar Jan 18 '13 at 15:09
    
Anyway, I'm rather confused about your question, since none of the answers in the referenced question uses flock... –  sr_ Jan 18 '13 at 15:13
    
@sr_ Sorry about that.. flock was mentioned in a comment. –  Kent Pawar Jan 18 '13 at 15:19
1  
@sr_ and others: note that this question specifically asks about NFS. Many NFS implementations have race conditions that break many locking techniques. Solaris's NFS implementation is better than most, but please do not close this question as a duplicate of one that doesn't focus on NFS. Kent: are all the clients and the server running Solaris? –  Gilles Jan 18 '13 at 23:11
add comment

marked as duplicate by Nils, uther, warl0ck, jasonwryan, Renan Jan 20 '13 at 2:58

This question has been asked before and already has an answer. If those answers do not fully address your question, please ask a new question.

1 Answer

Is simple a lock file, created with touch or echo, too weak for you system?

share|improve this answer
4  
That results in the much talked about race condition. –  Kent Pawar Jan 18 '13 at 15:29
add comment

Not the answer you're looking for? Browse other questions tagged or ask your own question.