The lsof package is useful to LiSt Open Files for a given running application or process.
This package is known to build and work properly using an LFS 11.3 platform.
Download (HTTP): https://github.com/lsof-org/lsof/releases/download/4.95.0/lsof_4.95.0.linux.tar.bz2
Download MD5 sum: 670010707104b1b1fc4cabae974465a6
Download size: 512 KB
Estimated disk space required: 3.3 MB (add 700 KB for tests)
Estimated build time: less than 0.1 SBU (add 0.5 SBU for tests)
Nmap-7.93 (with a symbolic link nc
pointing to ncat in
/usr/bin
; used in tests)
User Notes: https://wiki.linuxfromscratch.org/blfs/wiki/lsof
To run the tests, the following option should be enabled in the kernel configuration:
General setup --->
[*] POSIX Message Queues [CONFIG_POSIX_MQUEUE]
Install lsof by running the following commands:
./Configure -n linux && make
The tests should be run as the root
user. They require that the
POSIX message queues are enabled in the kernel, and that Nmap-7.93 be installed with a symbolic link
/usr/bin/nc
pointing to ncat.
make check
One test, case-20-ux-socket-endpoint, is known to fail. Other test may fail if the tests are run in a script.
Now, as the root
user:
install -v -m4755 -o root -g root lsof /usr/bin && install -v lsof.8 /usr/share/man/man8
./Configure -n linux: Avoid AFS, customization, and inventory checks, and use the linux dialect.
install -m4755 ...: lsof should
be suid root to allow users to list all files. This may be a security
threat on some systems. In that case change to -m755
and use sudo to run the program.