I have a Bash script that runs in multiple processess concurrently. The relevant portion looks like this:
flock /var/lock/my_lock my_command
Given that /var/lock/my_lock
exists, is there a way to determine which process owns it and thus which one is executing my_command
?