lockfile - conditional semaphore-file creator | | |
| | ...

DESCRIPTION
can be used to create one or more If lockfile can't create all the specified files (in the specified order), it waits (defaults to 8) seconds and retries the last file that didn't succeed. You can specify the number of to do until failure is returned. If the number of is 0 (default) lockfile will retry forever. If the number of expires before all files have been created, lockfile returns failure and removes all the files it created up till that point. The return value of lockfile can be easily inverted by specifying as an argument (comes in handy in shell scripts). All flags can be specified anywhere on the command line, they will be processed when encountered. The command line is simply parsed from left to right. All files created by lockfile will have access permission 0, and therefore will have to be removed with If you specify a then a lockfile will be removed by force after locktimeout seconds have passed since the lockfile was last modified/created. After a lockfile is removed by force, a suspension of seconds (defaults to 16) is taken into account, in order to prevent the inadvertent immediate removal of any newly created lockfile by another program (compare in

SEE ALSO

DIAGNOSTICS
Forcing lock on "x" Specified lockfile is going to be removed by force because of a timeout (compare in

BUGS
lockfile is only a simple program and can't process concatenated options.

NOTES
Multiple flags will toggle the return status. Since flags can occur anywhere on the command line, any filename starting with a '-' has to be preceded by './'. The number of is global. That is, it is not reset when a new file is being created. It can, however, be reset by specifying after every file on the command line. lockfile performs the locking in an NFS-secure way.

AUTHOR
Stephen R. van den Berg at RWTH-Aachen, Germany berg@messua.informatik.rwth-aachen.de
berg@physik.tu-muenchen.de