(no title)
Zacru | 7 months ago
I would say one good reason is that
waitlock myapp &
JOB_PID=$!
# ... do exclusive work ...
kill $JOB_PID
is a lot easier to use and remember than (; flock -n 9 || exit 1; # ... commands executed under lock ...; ) 9>/var/lock/mylockfile
yjftsjthsd-h|7 months ago
apopapo|7 months ago
permalac|7 months ago
Flock -s file && script.
Pretty simple. (I forgot the argument, I think is -s..
bigattichouse|7 months ago
waitlock myapp & #... do stuff waitlock --done myapp