Re: ITP: hatools -- The halockrun program provides a simple way to implement locking in shell scripts.
* Igshaan Mesias
| Hi
|
| > | On Jun 18, Igshaan Mesias <igshaan.mesias@gmail.com> wrote:
| > |
| > | > Description : The halockrun program provides a simple way to
| > | > implement locking in shell scripts.
| > |
| > | What does this offer over lockfile (procmail package) or dotlockfile
| > | (liblockfile1 package)?
| Aren't those used particularly for mailbox locking? The hatools package
| provides a wider application set for locking files.
|
| > Or even flock(1), which is part of util-linux.
|
| The major benefit halockrun has over these tools is that you can't have
| stale lock files with its implementation.
How can you have stale lock files with flock? flock(2) (which
flock(1) uses) operates on open files and those are always closed when
a process ends.
[...]
| halockrun also works on NFS shares if lockd is running. The node which
| hosts the halockrun instance which holds the lock will also take care
| not to stale the lock (the kernel again, not the user space). without
| having done any deeper checks, ITUMO more robust that dotlockrun.
This is something flock does not do; it does not lock over NFS.
--
Tollef Fog Heen
UNIX is user friendly, it's just picky about who its friends are
Reply to: