Hacking with listing local system locks

ABOUT lslocks

lslocks lists information about all the currently held file locks in a Linux system.

File locking is a mechanism that restricts access to a computer file by allowing only one user or process
access at any specific time. Systems implement locking to prevent the classic interceding update
scenario (see race condition).

[bash]
$lslocks -p 23897
$lslocks -p 1404
$lslocks -p 15099
$lslocks -p 17229
COMMAND PID TYPE SIZE MODE M START END PATH
chromium 17229 POSIX 68K WRITE 0 1073741824 1073742335 /home/jeffrin/.config/chromium/Default/Web Data
chromium 17229 POSIX 0B WRITE 0 0 0 /home/jeffrin/.config/chromium/Default/Local Extension Settings
chromium 17229 POSIX 140K WRITE 0 1073741824 1073742335 /home/jeffrin/.config/chromium/Default/History
chromium 17229 POSIX 1.5M WRITE 0 1073741824 1073742335 /home/jeffrin/.config/chromium/Default/Favicons
chromium 17229 POSIX 20K WRITE 0 1073741824 1073742335 /home/jeffrin/.config/chromium/Default/Shortcuts
chromium 17229 POSIX 12K WRITE 0 1073741824 1073742335 /home/jeffrin/.config/chromium/Default/Login Data
chromium 17229 POSIX 0B WRITE 0 0 0 /home/jeffrin/.config/chromium/Default/Extension Rules/LOCK
chromium 17229 POSIX 0B WRITE 0 0 0 /home/jeffrin/.config/chromium/Default/File System/Origins/LOCK
chromium 17229 POSIX 0B WRITE 0 0 0 /home/jeffrin/.config/chromium/Default/Session Storage/LOCK
chromium 17229 POSIX 0B WRITE 0 0 0 /home/jeffrin/.config/chromium/Default/Extension State/LOCK
$lslocks
COMMAND PID TYPE SIZE MODE M START END PATH
atd 580 POSIX 0B WRITE 0 0 0 /run
cron 614 FLOCK 0B WRITE 0 0 0 /run
tracker-miner-f 1505 POSIX 27.1M READ 0 1073741826 1073742335 /home/jeffrin/.cache/tracker/meta.db
tracker-miner-f 1505 POSIX 32K READ 0 128 128 /home/jeffrin/.cache/tracker/meta.db-shm
chromium 17229 POSIX 68K WRITE 0 1073741824 1073742335 /home/jeffrin/.config/chromium/Default/Web Data
chromium 17229 POSIX 0B WRITE 0 0 0 /home/jeffrin/.config/chromium/Default/Local Extension Setting
chromium 17229 POSIX 140K WRITE 0 1073741824 1073742335 /home/jeffrin/.config/chromium/Default/History
chromium 17229 POSIX 1.5M WRITE 0 1073741824 1073742335 /home/jeffrin/.config/chromium/Default/Favicons
chromium 17229 POSIX 20K WRITE 0 1073741824 1073742335 /home/jeffrin/.config/chromium/Default/Shortcuts
chromium 17229 POSIX 12K WRITE 0 1073741824 1073742335 /home/jeffrin/.config/chromium/Default/Login Data
(unknown) 543 FLOCK 0B WRITE 0 0 0 /run
lpd 594 FLOCK 0B WRITE 0 0 0 /run
runsv 670 FLOCK 0B WRITE 0 0 0 /
tracker-store 1512 POSIX 27.1M READ 0 1073741826 1073742335 /home/jeffrin/.cache/tracker/meta.db
tracker-store 1512 POSIX 32K READ 0 128 128 /home/jeffrin/.cache/tracker/meta.db-shm
chromium 17229 POSIX 0B WRITE 0 0 0 /home/jeffrin/.config/chromium/Default/Extension Rules/LOCK
chromium 17229 POSIX 0B WRITE 0 0 0 /home/jeffrin/.config/chromium/Default/File System/Origins/LOC
chromium 17229 POSIX 0B WRITE 0 0 0 /home/jeffrin/.config/chromium/Default/Session Storage/LOCK
chromium 17229 POSIX 0B WRITE 0 0 0 /home/jeffrin/.config/chromium/Default/Extension State/LOCK
$
[/bash]
LINKS
http://man7.org/linux/man-pages/man8/lslocks.8.html
https://unix.stackexchange.com/questions/85994/how-to-list-processes-locking-file