diff options
Diffstat (limited to '')
-rw-r--r-- | misc-utils/lslocks.8 | 41 | ||||
-rw-r--r-- | misc-utils/lslocks.8.adoc | 27 |
2 files changed, 57 insertions, 11 deletions
diff --git a/misc-utils/lslocks.8 b/misc-utils/lslocks.8 index 255742d..3f593a2 100644 --- a/misc-utils/lslocks.8 +++ b/misc-utils/lslocks.8 @@ -2,12 +2,12 @@ .\" Title: lslocks .\" Author: [see the "AUTHOR(S)" section] .\" Generator: Asciidoctor 2.0.20 -.\" Date: 2023-12-01 +.\" Date: 2024-03-20 .\" Manual: System Administration -.\" Source: util-linux 2.39.3 +.\" Source: util-linux 2.40 .\" Language: English .\" -.TH "LSLOCKS" "8" "2023-12-01" "util\-linux 2.39.3" "System Administration" +.TH "LSLOCKS" "8" "2024-03-20" "util\-linux 2.40" "System Administration" .ie \n(.g .ds Aq \(aq .el .ds Aq ' .ss \n[.ss] 0 @@ -35,8 +35,6 @@ lslocks \- list local system locks .SH "DESCRIPTION" .sp \fBlslocks\fP lists information about all the currently held file locks in a Linux system. -.sp -Note that lslocks also lists OFD (Open File Description) locks, these locks are not associated with any process (PID is \-1). OFD locks are associated with the open file description on which they are acquired. This lock type is available since Linux 3.15, see \fBfcntl\fP(2) for more details. .SH "OPTIONS" .sp \fB\-b\fP, \fB\-\-bytes\fP @@ -50,6 +48,11 @@ examples: "1 KiB" and "1 MiB" are respectively exhibited as "1 K" and "1 M", then omitting on purpose the mention "iB", which is part of these abbreviations. .RE .sp +\fB\-H\fP, \fB\-\-list\-columns\fP +.RS 4 +List the available columns, use with \fB\-\-json\fP or \fB\-\-raw\fP to get output in machine\-readable format. +.RE +.sp \fB\-i\fP, \fB\-\-noinaccessible\fP .RS 4 Ignore lock files which are inaccessible for the current user. @@ -110,12 +113,12 @@ The command name of the process holding the lock. .sp PID .RS 4 -The process ID of the process which holds the lock or \-1 for OFDLCK. +The process ID of the process. .RE .sp TYPE .RS 4 -The type of lock; can be FLOCK (created with \fBflock\fP(2)), POSIX (created with \fBfcntl\fP(2) and \fBlockf\fP(3)) or OFDLCK (created with \fBfcntl\fP(2)). +The type of lock; can be LEASE (created with \fBfcntl\fP(2)), FLOCK (created with \fBflock\fP(2)), POSIX (created with \fBfcntl\fP(2) and \fBlockf\fP(3)) or OFDLCK (created with \fBfcntl\fP(2)). .RE .sp SIZE @@ -123,6 +126,16 @@ SIZE Size of the locked file. .RE .sp +INODE +.RS 4 +The inode number. +.RE +.sp +MAJ:MIN +.RS 4 +The major:minor device number. +.RE +.sp MODE .RS 4 The lock\(cqs access permissions (read, write). If the process is blocked and waiting for the lock, then the mode is postfixed with an \*(Aq*\*(Aq (asterisk). @@ -152,11 +165,25 @@ BLOCKER .RS 4 The PID of the process which blocks the lock. .RE +.sp +HOLDERS +.RS 4 +The holder(s) of the lock. The format of the holder is \fIPID\fP,\fICOMMAND\fP,\fIFD\fP. +If a lock is an open file description\-oriented lock, there can be more than one holder for the lock. +See the NOTES below. +.RE .SH "NOTES" .sp The \fBlslocks\fP command is meant to replace the \fBlslk\fP(8) command, originally written by \c .MTO "abe\(atpurdue.edu" "Victor A. Abell" "" and unmaintained since 2001. +.sp +"The process holding the lock" for leases, FLOCK locks, and +OFD locks is a fake\-concept. They are associated with the open file +description on which they are acquired. With \fBfork\fP(2) and/or +\fBcmsg\fP(3), multiple processes can share an open file description. So +the holder process of a lease (or a lock) is not uniquely determined. +\fBlslocks\fP shows the one of the holder processes in COMMAND and PID columns. .SH "AUTHORS" .sp .MTO "dave\(atgnu.org" "Davidlohr Bueso" "" diff --git a/misc-utils/lslocks.8.adoc b/misc-utils/lslocks.8.adoc index 21ad643..2084d96 100644 --- a/misc-utils/lslocks.8.adoc +++ b/misc-utils/lslocks.8.adoc @@ -29,13 +29,14 @@ lslocks - list local system locks *lslocks* lists information about all the currently held file locks in a Linux system. -Note that lslocks also lists OFD (Open File Description) locks, these locks are not associated with any process (PID is -1). OFD locks are associated with the open file description on which they are acquired. This lock type is available since Linux 3.15, see *fcntl*(2) for more details. - == OPTIONS *-b*, *--bytes*:: include::man-common/in-bytes.adoc[] +*-H*, *--list-columns*:: +List the available columns, use with *--json* or *--raw* to get output in machine-readable format. + *-i*, *--noinaccessible*:: Ignore lock files which are inaccessible for the current user. @@ -71,14 +72,20 @@ COMMAND:: The command name of the process holding the lock. PID:: -The process ID of the process which holds the lock or -1 for OFDLCK. +The process ID of the process. TYPE:: -The type of lock; can be FLOCK (created with *flock*(2)), POSIX (created with *fcntl*(2) and *lockf*(3)) or OFDLCK (created with *fcntl*(2)). +The type of lock; can be LEASE (created with *fcntl*(2)), FLOCK (created with *flock*(2)), POSIX (created with *fcntl*(2) and *lockf*(3)) or OFDLCK (created with *fcntl*(2)). SIZE:: Size of the locked file. +INODE:: +The inode number. + +MAJ:MIN:: +The major:minor device number. + MODE:: The lock's access permissions (read, write). If the process is blocked and waiting for the lock, then the mode is postfixed with an '*' (asterisk). @@ -97,10 +104,22 @@ Full path of the lock. If none is found, or there are no permissions to read the BLOCKER:: The PID of the process which blocks the lock. +HOLDERS:: +The holder(s) of the lock. The format of the holder is _PID_,_COMMAND_,_FD_. +If a lock is an open file description-oriented lock, there can be more than one holder for the lock. +See the NOTES below. + == NOTES The *lslocks* command is meant to replace the *lslk*(8) command, originally written by mailto:abe@purdue.edu[Victor A. Abell] and unmaintained since 2001. +"The process holding the lock" for leases, FLOCK locks, and +OFD locks is a fake-concept. They are associated with the open file +description on which they are acquired. With *fork*(2) and/or +*cmsg*(3), multiple processes can share an open file description. So +the holder process of a lease (or a lock) is not uniquely determined. +*lslocks* shows the one of the holder processes in COMMAND and PID columns. + == AUTHORS mailto:dave@gnu.org[Davidlohr Bueso] |