Dua kemungkinan: lsof
(preferensi saya) atau lslk
(khusus untuk kunci file):
[root@policyServer ~]# lslk | grep "master.lock"
SRC PID DEV INUM SZ TY M ST WH END LEN NAME
master 1650 253,0 12423 33 w 0 0 0 0 0 /var/lib/postfix/master.lock
[root@policyServer ~]# lsof | grep "master.lock"
master 1650 root 10uW REG 253,0 33 12423 /var/lib/postfix/master.lock
Output lslk adalah self-expanatory tetapi lsof
menempatkan deskripsi kunci di kolom "FD" (yang di 10uW
atas). Dari halaman manual:
The mode character is followed by one of these lock characters, describing the type of lock applied to the file:
N for a Solaris NFS lock of unknown type;
r for read lock on part of the file;
R for a read lock on the entire file;
w for a write lock on part of the file;
W for a write lock on the entire file;
u for a read and write lock of any length;
U for a lock of unknown type;
x for an SCO OpenServer Xenix lock on part of the file;
X for an SCO OpenServer Xenix lock on the entire file;
space if there is no lock.
Jadi kolom "FD" di lsof
atas terurai menjadi:
10
Deskriptor literal dari file terbuka ini. Apa yang ditautkan oleh/proc/1650/fd/10
u
File terbuka untuk membaca dan menulis
W
Program memiliki kunci tulis pada file.