Can we tell if a command is being run by a process or not, by looking at the flock lock file alone?
0
votes
2
answers
576
views
Is util-linux's
flock
implemented based on flock()
in Linux C API?
Can we tell if a command is being run by a process or not, by looking at the lock file alone?
I found that when a command guarded by flock
finishes running, there seems no change to the lock file. Here is when it is running and after it finishes running:
$ ls -l ../sleep.flock.file
-rw-rw-r-- 1 t t 0 Oct 30 14:01 ../sleep.flock.file
$ ls -l ../sleep.flock.file
-rw-rw-r-- 1 t t 0 Oct 30 14:01 ../sleep.flock.file
Thanks.
Asked by Tim
(106430 rep)
Oct 30, 2018, 06:09 PM
Last activity: Dec 20, 2021, 09:11 PM
Last activity: Dec 20, 2021, 09:11 PM