Choice of filehandle for flock utility
题
The flock
utility man page gives the following usage example:
(
flock -s 200
# ... commands executed under lock ...
) 200>/var/lock/mylockfile
Assuming 200
is the filehandle of the lockfile, is there a possibility that during some run it fails, because the same filehandle is already in use by other process? If so, are there any tricks to make sure locking with flock
works reliably?
没有正确的解决方案
不隶属于 StackOverflow