!!!NOTICE!!! !!!NOTICE!!! !!!NOTICE!!! !!!NOTICE!!! !!!NOTICE!!!!
! !
! Revision 1.29 represents the end of life for lslk. I don't have time !
! to support it. Please don't report bugs to me. I will politely !
! decline to work on them. !
! !
! Vic Abell <abe@purdue.edu>, July 11, 2001 !
! !
!!!NOTICE!!! !!!NOTICE!!! !!!NOTICE!!! !!!NOTICE!!! !!!NOTICE!!!!
lslk - list local locks
AIX 3.2.5, 4.1.4, 4.2[.1], and AIX 4.3[.[12]] DEC OSF/1, Digital UNIX, and Tru64 UNIX [2345].[01] and 3.2 Linux SCO OpenDesktop or OpenServer 3.0 and 5.0.[0245] Sequent PTX 2.1.9, 4.2.1, 4.3, and 4.4 Solaris 2.[345], 2.5.1, 2.6, 7, and 8 (excluding Veritas VxFS local files) SunOS 4.1.3
The lock may belong to a process on the local system or to a process on an NFS client system to which the local system is an NFS server. Notes: Linux and PTX 2.1.9 lslk don't report on locks held by NFS clients; Solaris lslk won't report locks held on local Veritas VxFS files.
When selection options are specified, the listing of all locks is disabled, and the selection options are ORed together. Only locks meeting any selection criterion are listed.
When the -a option is specified, the listing of all locks is disabled, and the selection options are ANDed together. Only locks that meet all selection criteria are listed.
r read;
rw read and write;
w write;
? unknown.
Lslk attempts to break these blocks with timers and child processes, but the techniques are not wholly reliable. When lslk does manage to break a block, it will report the break with an error message. The messages may be suppressed with the -w option.
The default timeout value may be displayed with the -h option, and it may be changed with the -S [t] option. The minimum for t is two seconds, but you should avoid small values, since slow system responsiveness can cause short timeouts to expire unexpectedly and perhaps stop lslk before it can produce any output.
When lslk has to break a block during its access of mounted file system information, it normally continues, although with less information available to display about open files.
Lslk can also be directed to avoid the protection of timers and child processes when using the kernel functions that might block by specifying the -O option. While this will allow lslk to start up with less overhead, it exposes lslk completely to the kernel situations that might block it. Use this option cautiously.
You can use the -b option to tell lslk to avoid using kernel functions that would block. Some cautions apply.
First, using this option usually requires that your system supply alternate device numbers in place of the device numbers that lslk would normally obtain with the lstat(2) and stat(2) kernel functions. See the ALTERNATE DEVICE NUMBERS section for more information on alternate device numbers.
Second, you can't specify the names of files you want lslk to locate locks for unless they're file system names. This is because lslk needs to know the device and inode numbers of files listed with names in the lslk options, and the -b option prevents lslk from obtaining them. Moreover, since lslk only has device numbers for the file systems that have alternates, its ability to locate locks on file systems depends completely on the availability and accuracy of the alternates. If no alternates are available, or if they're incorrect, lslk won't be able to locate locks on the named file systems.
Third, if the names of your file system directories that lslk obtains from your system's mount table are symbolic links, lslk won't be able to resolve the links. This is because the -b option causes lslk to avoid the kernel readlink(2) function it uses to resolve symbolic links.
Finally, using the -b option causes lslk to issue warning messages when it needs to use the kernel functions that the -b option directs it to avoid. You can suppress these messages by specifying the -w option, but if you do, you won't see the alternate device numbers reported in the warning messages.
On some dialects, when lslk has to break a block because it can't get information about a mounted file system via the lstat(2) and stat(2) kernel functions, or because you specified the -b option, lslk can obtain some of the information it needs - the device number and possibly the file system type - from the system mount table. When that is possible, lslk will report the device number it obtained. (You can suppress the report by specifying the -w option.)
You can assist this process if your mount table is supported with an /etc/mtab or /etc/mnttab file that contains an options field by adding a ``dev=xxxx'' field for mount points that do not have one in their options strings.
The ``xxxx'' portion of the field is the hexadecimal value of the file system's device number. (Consult the st_dev field of the output of the lstat(2) and stat(2) functions for the appropriate values for your file systems.) Here's an example from a Solaris 2.5 /etc/mnttab for a UFS file system:
... ufs suid,rw,dev=80001f ...
Some dialects that do not use an ASCII /etc/mtab or /etc/mnttab file for the mount table may still provide an alternative device number in their internal mount tables. This includes AIX, DEC OSF/1, Digital UNIX, and Tru64 UNIX. Lslk knows how to obtain the alternative device number for these dialects and uses it when its attempt to lstat(2) or stat(2) the file system is blocked.
If you're not sure your dialect supplies alternate device numbers for file systems from its mount table, use this lslk incantation to see if it reports any alternate device numbers:
Look for standard error file warning messages that begin ``assuming "dev=xxxx" from ...''.
Lslk returns a one (1) if an error was detected or if it couldn't list lock information for all the names that were specified.
To list locks from the host ``klaatu'' in the local domain, use:
To list locks from the hosts helios.cc.purdue.edu and vic1.cc.purdue.edu, use:
To list locks held by processes 1234 and 56789, use:
To list all locks held by process 1234 on host klaatu, use:
DEC OSF/1, Digital UNIX, and Tru64 UNIX lslk won't find locks applied with the flock(2) function. It will find locks applied with the fcntl(2) and lockf(3) functions.
Linux lslk will not report locks held by NFS clients. It may have difficulty reporting locks held on dynamic inodes (e.g., for the Win-95 file system type, smbfs).
Chris Eleveld <chris@sector7.com> did the DEC OSF/1, Digital UNIX, Linux, and Tru64 UNIX ports.
Закладки на сайте Проследить за страницей |
Created 1996-2024 by Maxim Chirkov Добавить, Поддержать, Вебмастеру |