[ab4fdfc] | 1 | <?xml version="1.0" encoding="UTF-8"?>
|
---|
[740597c] | 2 | <!DOCTYPE sect1 PUBLIC "-//OASIS//DTD DocBook XML V4.5//EN"
|
---|
| 3 | "http://www.oasis-open.org/docbook/xml/4.5/docbookx.dtd" [
|
---|
| 4 | <!ENTITY % general-entities SYSTEM "../../general.ent">
|
---|
| 5 | %general-entities;
|
---|
| 6 |
|
---|
[e13b365] | 7 |
|
---|
[a957507] | 8 | <!ENTITY lsof-download-http "https://github.com/lsof-org/lsof/releases/download/&lsof-version;/lsof-&lsof-version;.tar.gz">
|
---|
[2a54f99] | 9 | <!ENTITY lsof-download-ftp " ">
|
---|
[a957507] | 10 | <!ENTITY lsof-md5sum "8c858675f6d6e137df9b4e26ad6c46e8">
|
---|
| 11 | <!ENTITY lsof-size "1.1 MB">
|
---|
| 12 | <!ENTITY lsof-buildsize "14 MB (with tests)">
|
---|
| 13 | <!ENTITY lsof-time "0.1 SBU (with tests)">
|
---|
[740597c] | 14 | ]>
|
---|
| 15 |
|
---|
| 16 | <sect1 id="lsof" xreflabel="lsof-&lsof-version;">
|
---|
| 17 | <?dbhtml filename="lsof.html"?>
|
---|
| 18 |
|
---|
| 19 |
|
---|
| 20 | <title>lsof-&lsof-version;</title>
|
---|
| 21 |
|
---|
| 22 | <indexterm zone="lsof">
|
---|
| 23 | <primary sortas="a-lsof">lsof</primary>
|
---|
| 24 | </indexterm>
|
---|
| 25 |
|
---|
| 26 | <sect2 role="package">
|
---|
| 27 | <title>Introduction to lsof</title>
|
---|
| 28 |
|
---|
[b7a85cd9] | 29 | <para>
|
---|
| 30 | The <application>lsof</application> package is useful to LiSt Open
|
---|
| 31 | Files for a given running application or process.
|
---|
| 32 | </para>
|
---|
[740597c] | 33 |
|
---|
[aa996df1] | 34 | &lfs122_checked;
|
---|
[740597c] | 35 |
|
---|
| 36 | <bridgehead renderas="sect3">Package Information</bridgehead>
|
---|
| 37 | <itemizedlist spacing="compact">
|
---|
| 38 | <listitem>
|
---|
[b7a85cd9] | 39 | <para>
|
---|
| 40 | Download (HTTP): <ulink url="&lsof-download-http;"/>
|
---|
| 41 | </para>
|
---|
[740597c] | 42 | </listitem>
|
---|
| 43 | <listitem>
|
---|
[b7a85cd9] | 44 | <para>
|
---|
| 45 | Download (FTP): <ulink url="&lsof-download-ftp;"/>
|
---|
| 46 | </para>
|
---|
[740597c] | 47 | </listitem>
|
---|
| 48 | <listitem>
|
---|
[b7a85cd9] | 49 | <para>
|
---|
| 50 | Download MD5 sum: &lsof-md5sum;
|
---|
| 51 | </para>
|
---|
[740597c] | 52 | </listitem>
|
---|
| 53 | <listitem>
|
---|
[b7a85cd9] | 54 | <para>
|
---|
| 55 | Download size: &lsof-size;
|
---|
| 56 | </para>
|
---|
[740597c] | 57 | </listitem>
|
---|
| 58 | <listitem>
|
---|
[b7a85cd9] | 59 | <para>
|
---|
| 60 | Estimated disk space required: &lsof-buildsize;
|
---|
| 61 | </para>
|
---|
[740597c] | 62 | </listitem>
|
---|
| 63 | <listitem>
|
---|
[b7a85cd9] | 64 | <para>
|
---|
| 65 | Estimated build time: &lsof-time;
|
---|
| 66 | </para>
|
---|
[740597c] | 67 | </listitem>
|
---|
| 68 | </itemizedlist>
|
---|
| 69 |
|
---|
[2eef4339] | 70 | <bridgehead renderas="sect3">lsof Dependencies</bridgehead>
|
---|
| 71 |
|
---|
| 72 | <bridgehead renderas="sect4">Required</bridgehead>
|
---|
| 73 | <para role="required">
|
---|
| 74 | <xref linkend="libtirpc"/>
|
---|
| 75 | </para>
|
---|
| 76 |
|
---|
[141ee0a5] | 77 | <bridgehead renderas="sect4">Optional</bridgehead>
|
---|
| 78 | <para role="optional">
|
---|
| 79 | <xref linkend="nmap"/> (with a symbolic link <command>nc</command>
|
---|
| 80 | pointing to <command>ncat</command> in <filename class="directory">
|
---|
| 81 | /usr/bin</filename>; used in tests)
|
---|
| 82 | </para>
|
---|
| 83 |
|
---|
[740597c] | 84 | </sect2>
|
---|
| 85 |
|
---|
[141ee0a5] | 86 | <sect2 role="kernel" id="lsof-kernel">
|
---|
| 87 | <title>Kernel Configuration</title>
|
---|
| 88 |
|
---|
| 89 | <para>
|
---|
[d0f62ed] | 90 | To run the tests, the following option should be enabled in the kernel
|
---|
[141ee0a5] | 91 | configuration:
|
---|
| 92 | </para>
|
---|
| 93 |
|
---|
[e7cd19a] | 94 | <xi:include xmlns:xi="http://www.w3.org/2001/XInclude"
|
---|
| 95 | href="lsof-test-kernel.xml"/>
|
---|
| 96 |
|
---|
| 97 | <indexterm zone="lsof lsof-kernel">
|
---|
| 98 | <primary sortas="d-lsof">lsof (testing)</primary>
|
---|
| 99 | </indexterm>
|
---|
[141ee0a5] | 100 |
|
---|
| 101 | </sect2>
|
---|
| 102 |
|
---|
[740597c] | 103 | <sect2 role="installation">
|
---|
| 104 | <title>Installation of lsof</title>
|
---|
| 105 |
|
---|
[b7a85cd9] | 106 | <para>
|
---|
[141ee0a5] | 107 | Install <application>lsof</application> by running the
|
---|
[b7a85cd9] | 108 | following commands:
|
---|
| 109 | </para>
|
---|
[740597c] | 110 |
|
---|
[a957507] | 111 | <screen><userinput>./configure --prefix=/usr --disable-static &&
|
---|
[141ee0a5] | 112 | make</userinput></screen>
|
---|
| 113 |
|
---|
| 114 | <para>
|
---|
| 115 | The tests should be run as the <systemitem
|
---|
| 116 | class="username">root</systemitem> user. They require that the
|
---|
| 117 | POSIX message queues are enabled in the kernel, and that <xref
|
---|
| 118 | linkend="nmap"/> be installed with a symbolic link
|
---|
| 119 | <filename>/usr/bin/nc</filename> pointing to <command>ncat</command>.
|
---|
| 120 | </para>
|
---|
| 121 |
|
---|
| 122 | <screen role="root"
|
---|
| 123 | remap="test"><userinput>make check</userinput></screen>
|
---|
[740597c] | 124 |
|
---|
[a957507] | 125 | <!--
|
---|
[b7a85cd9] | 126 | <para>
|
---|
[1fe05eb] | 127 | One test, case-20-ux-socket-endpoint, is known to fail.
|
---|
[d0f62ed] | 128 | Other test may fail if the tests are run in a script.
|
---|
[b7a85cd9] | 129 | </para>
|
---|
[a957507] | 130 | -->
|
---|
[740597c] | 131 |
|
---|
[b7a85cd9] | 132 | <para>
|
---|
| 133 | Now, as the <systemitem class="username">root</systemitem> user:
|
---|
| 134 | </para>
|
---|
[740597c] | 135 |
|
---|
[a957507] | 136 | <screen role="root"><userinput>make install</userinput></screen>
|
---|
[740597c] | 137 |
|
---|
| 138 | </sect2>
|
---|
| 139 |
|
---|
[2eef4339] | 140 | <sect2 role="commands">
|
---|
| 141 | <title>Command Explanations</title>
|
---|
| 142 |
|
---|
[a957507] | 143 | <!--
|
---|
[2eef4339] | 144 | <para>
|
---|
[c684b9d] | 145 | <command>./Configure -n linux</command>: Avoid AFS, customization, and
|
---|
[f3429309] | 146 | inventory checks, and use the linux dialect.
|
---|
[2eef4339] | 147 | </para>
|
---|
| 148 |
|
---|
| 149 | <para>
|
---|
[141ee0a5] | 150 | <command>install -m4755 ...</command>: <command>lsof</command> should
|
---|
[b9c353b] | 151 | be suid root to allow users to list all files. This may be a security
|
---|
[141ee0a5] | 152 | threat on some systems. In that case change to <option>-m755</option>
|
---|
| 153 | and use <command>sudo</command> to run the program.
|
---|
[2eef4339] | 154 | </para>
|
---|
[a957507] | 155 | -->
|
---|
| 156 |
|
---|
| 157 | <xi:include xmlns:xi="http://www.w3.org/2001/XInclude"
|
---|
| 158 | href="../../xincludes/static-libraries.xml"/>
|
---|
[2eef4339] | 159 |
|
---|
| 160 | </sect2>
|
---|
| 161 |
|
---|
[740597c] | 162 | <sect2 role="content">
|
---|
| 163 | <title>Contents</title>
|
---|
| 164 |
|
---|
| 165 | <segmentedlist>
|
---|
| 166 | <segtitle>Installed Program</segtitle>
|
---|
| 167 | <segtitle>Installed Libraries</segtitle>
|
---|
| 168 | <segtitle>Installed Directories</segtitle>
|
---|
| 169 |
|
---|
| 170 | <seglistitem>
|
---|
| 171 | <seg>lsof</seg>
|
---|
[a957507] | 172 | <seg>liblsof.so</seg>
|
---|
[740597c] | 173 | <seg>None</seg>
|
---|
| 174 | </seglistitem>
|
---|
| 175 | </segmentedlist>
|
---|
| 176 |
|
---|
| 177 | <variablelist>
|
---|
| 178 | <bridgehead renderas="sect3">Short Descriptions</bridgehead>
|
---|
| 179 | <?dbfo list-presentation="list"?>
|
---|
| 180 | <?dbhtml list-presentation="table"?>
|
---|
| 181 |
|
---|
| 182 | <varlistentry id="lsof-app">
|
---|
| 183 | <term><command>lsof</command></term>
|
---|
| 184 | <listitem>
|
---|
[b7a85cd9] | 185 | <para>
|
---|
[4c24eb0a] | 186 | lists open files for running processes
|
---|
[b7a85cd9] | 187 | </para>
|
---|
[740597c] | 188 | <indexterm zone="lsof lsof-app">
|
---|
| 189 | <primary sortas="b-lsof">lsof</primary>
|
---|
| 190 | </indexterm>
|
---|
| 191 | </listitem>
|
---|
| 192 | </varlistentry>
|
---|
| 193 |
|
---|
[a957507] | 194 | <varlistentry id="liblsof">
|
---|
| 195 | <term><filename class="libraryfile">liblsof.so</filename></term>
|
---|
| 196 | <listitem>
|
---|
| 197 | <para>
|
---|
| 198 | contains an interface for applications to list open files
|
---|
| 199 | </para>
|
---|
| 200 | <indexterm zone="lsof liblsof">
|
---|
| 201 | <primary sortas="c-liblsof">liblsof.so</primary>
|
---|
| 202 | </indexterm>
|
---|
| 203 | </listitem>
|
---|
| 204 | </varlistentry>
|
---|
| 205 |
|
---|
[740597c] | 206 | </variablelist>
|
---|
| 207 |
|
---|
| 208 | </sect2>
|
---|
| 209 |
|
---|
| 210 | </sect1>
|
---|