[740597c] | 1 | <?xml version="1.0" encoding="ISO-8859-1"?>
|
---|
| 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 |
|
---|
[141ee0a5] | 8 | <!ENTITY lsof-download-http "https://github.com/lsof-org/lsof/releases/download/&lsof-version;/lsof_&lsof-version;.linux.tar.bz2">
|
---|
[2a54f99] | 9 | <!ENTITY lsof-download-ftp " ">
|
---|
[d0f62ed] | 10 | <!ENTITY lsof-md5sum "670010707104b1b1fc4cabae974465a6">
|
---|
| 11 | <!ENTITY lsof-size "512 KB">
|
---|
| 12 | <!ENTITY lsof-buildsize "3.3 MB (add 700 KB for tests)">
|
---|
| 13 | <!ENTITY lsof-time "less than 0.1 SBU (add 0.5 SBU for tests)">
|
---|
[740597c] | 14 | ]>
|
---|
| 15 |
|
---|
| 16 | <sect1 id="lsof" xreflabel="lsof-&lsof-version;">
|
---|
| 17 | <?dbhtml filename="lsof.html"?>
|
---|
| 18 |
|
---|
| 19 | <sect1info>
|
---|
| 20 | <date>$Date$</date>
|
---|
| 21 | </sect1info>
|
---|
| 22 |
|
---|
| 23 | <title>lsof-&lsof-version;</title>
|
---|
| 24 |
|
---|
| 25 | <indexterm zone="lsof">
|
---|
| 26 | <primary sortas="a-lsof">lsof</primary>
|
---|
| 27 | </indexterm>
|
---|
| 28 |
|
---|
| 29 | <sect2 role="package">
|
---|
| 30 | <title>Introduction to lsof</title>
|
---|
| 31 |
|
---|
[b7a85cd9] | 32 | <para>
|
---|
| 33 | The <application>lsof</application> package is useful to LiSt Open
|
---|
| 34 | Files for a given running application or process.
|
---|
| 35 | </para>
|
---|
[740597c] | 36 |
|
---|
[ca783379] | 37 | &lfs111_checked;
|
---|
[740597c] | 38 |
|
---|
| 39 | <bridgehead renderas="sect3">Package Information</bridgehead>
|
---|
| 40 | <itemizedlist spacing="compact">
|
---|
| 41 | <listitem>
|
---|
[b7a85cd9] | 42 | <para>
|
---|
| 43 | Download (HTTP): <ulink url="&lsof-download-http;"/>
|
---|
| 44 | </para>
|
---|
[740597c] | 45 | </listitem>
|
---|
| 46 | <listitem>
|
---|
[b7a85cd9] | 47 | <para>
|
---|
| 48 | Download (FTP): <ulink url="&lsof-download-ftp;"/>
|
---|
| 49 | </para>
|
---|
[740597c] | 50 | </listitem>
|
---|
| 51 | <listitem>
|
---|
[b7a85cd9] | 52 | <para>
|
---|
| 53 | Download MD5 sum: &lsof-md5sum;
|
---|
| 54 | </para>
|
---|
[740597c] | 55 | </listitem>
|
---|
| 56 | <listitem>
|
---|
[b7a85cd9] | 57 | <para>
|
---|
| 58 | Download size: &lsof-size;
|
---|
| 59 | </para>
|
---|
[740597c] | 60 | </listitem>
|
---|
| 61 | <listitem>
|
---|
[b7a85cd9] | 62 | <para>
|
---|
| 63 | Estimated disk space required: &lsof-buildsize;
|
---|
| 64 | </para>
|
---|
[740597c] | 65 | </listitem>
|
---|
| 66 | <listitem>
|
---|
[b7a85cd9] | 67 | <para>
|
---|
| 68 | Estimated build time: &lsof-time;
|
---|
| 69 | </para>
|
---|
[740597c] | 70 | </listitem>
|
---|
| 71 | </itemizedlist>
|
---|
| 72 |
|
---|
[2eef4339] | 73 | <bridgehead renderas="sect3">lsof Dependencies</bridgehead>
|
---|
| 74 |
|
---|
| 75 | <bridgehead renderas="sect4">Required</bridgehead>
|
---|
| 76 | <para role="required">
|
---|
| 77 | <xref linkend="libtirpc"/>
|
---|
| 78 | </para>
|
---|
| 79 |
|
---|
[141ee0a5] | 80 | <bridgehead renderas="sect4">Optional</bridgehead>
|
---|
| 81 | <para role="optional">
|
---|
| 82 | <xref linkend="nmap"/> (with a symbolic link <command>nc</command>
|
---|
| 83 | pointing to <command>ncat</command> in <filename class="directory">
|
---|
| 84 | /usr/bin</filename>; used in tests)
|
---|
| 85 | </para>
|
---|
| 86 |
|
---|
[740597c] | 87 | <para condition="html" role="usernotes">User Notes:
|
---|
| 88 | <ulink url="&blfs-wiki;/lsof"/></para>
|
---|
| 89 |
|
---|
| 90 | </sect2>
|
---|
| 91 |
|
---|
[141ee0a5] | 92 | <sect2 role="kernel" id="lsof-kernel">
|
---|
| 93 | <title>Kernel Configuration</title>
|
---|
| 94 |
|
---|
| 95 | <para>
|
---|
[d0f62ed] | 96 | To run the tests, the following option should be enabled in the kernel
|
---|
[141ee0a5] | 97 | configuration:
|
---|
| 98 | </para>
|
---|
| 99 |
|
---|
| 100 | <screen><literal>General setup --->
|
---|
| 101 | [*] POSIX Message Queues [CONFIG_POSIX_MQUEUE]</literal></screen>
|
---|
| 102 |
|
---|
| 103 | </sect2>
|
---|
| 104 |
|
---|
[740597c] | 105 | <sect2 role="installation">
|
---|
| 106 | <title>Installation of lsof</title>
|
---|
| 107 |
|
---|
[b7a85cd9] | 108 | <para>
|
---|
[141ee0a5] | 109 | Install <application>lsof</application> by running the
|
---|
[b7a85cd9] | 110 | following commands:
|
---|
| 111 | </para>
|
---|
[740597c] | 112 |
|
---|
[141ee0a5] | 113 | <screen><userinput>./Configure -n linux &&
|
---|
| 114 | make</userinput></screen>
|
---|
| 115 |
|
---|
| 116 | <para>
|
---|
| 117 | The tests should be run as the <systemitem
|
---|
| 118 | class="username">root</systemitem> user. They require that the
|
---|
| 119 | POSIX message queues are enabled in the kernel, and that <xref
|
---|
| 120 | linkend="nmap"/> be installed with a symbolic link
|
---|
| 121 | <filename>/usr/bin/nc</filename> pointing to <command>ncat</command>.
|
---|
| 122 | </para>
|
---|
| 123 |
|
---|
| 124 | <screen role="root"
|
---|
| 125 | remap="test"><userinput>make check</userinput></screen>
|
---|
[740597c] | 126 |
|
---|
[b7a85cd9] | 127 | <para>
|
---|
[d0f62ed] | 128 | One test, case-20-ux-socket-endpoint, is known to fail.
|
---|
| 129 | Other test may fail if the tests are run in a script.
|
---|
[b7a85cd9] | 130 | </para>
|
---|
[740597c] | 131 |
|
---|
[b7a85cd9] | 132 | <para>
|
---|
| 133 | Now, as the <systemitem class="username">root</systemitem> user:
|
---|
| 134 | </para>
|
---|
[740597c] | 135 |
|
---|
[141ee0a5] | 136 | <screen role="root"><userinput>install -v -m4755 -o root -g root lsof /usr/bin &&
|
---|
[740597c] | 137 | install -v lsof.8 /usr/share/man/man8</userinput></screen>
|
---|
| 138 |
|
---|
| 139 | </sect2>
|
---|
| 140 |
|
---|
[2eef4339] | 141 | <sect2 role="commands">
|
---|
| 142 | <title>Command Explanations</title>
|
---|
| 143 |
|
---|
| 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>
|
---|
| 155 |
|
---|
| 156 | </sect2>
|
---|
| 157 |
|
---|
[740597c] | 158 | <sect2 role="content">
|
---|
| 159 | <title>Contents</title>
|
---|
| 160 |
|
---|
| 161 | <segmentedlist>
|
---|
| 162 | <segtitle>Installed Program</segtitle>
|
---|
| 163 | <segtitle>Installed Libraries</segtitle>
|
---|
| 164 | <segtitle>Installed Directories</segtitle>
|
---|
| 165 |
|
---|
| 166 | <seglistitem>
|
---|
| 167 | <seg>lsof</seg>
|
---|
| 168 | <seg>None</seg>
|
---|
| 169 | <seg>None</seg>
|
---|
| 170 | </seglistitem>
|
---|
| 171 | </segmentedlist>
|
---|
| 172 |
|
---|
| 173 | <variablelist>
|
---|
| 174 | <bridgehead renderas="sect3">Short Descriptions</bridgehead>
|
---|
| 175 | <?dbfo list-presentation="list"?>
|
---|
| 176 | <?dbhtml list-presentation="table"?>
|
---|
| 177 |
|
---|
| 178 | <varlistentry id="lsof-app">
|
---|
| 179 | <term><command>lsof</command></term>
|
---|
| 180 | <listitem>
|
---|
[b7a85cd9] | 181 | <para>
|
---|
[4c24eb0a] | 182 | lists open files for running processes
|
---|
[b7a85cd9] | 183 | </para>
|
---|
[740597c] | 184 | <indexterm zone="lsof lsof-app">
|
---|
| 185 | <primary sortas="b-lsof">lsof</primary>
|
---|
| 186 | </indexterm>
|
---|
| 187 | </listitem>
|
---|
| 188 | </varlistentry>
|
---|
| 189 |
|
---|
| 190 | </variablelist>
|
---|
| 191 |
|
---|
| 192 | </sect2>
|
---|
| 193 |
|
---|
| 194 | </sect1>
|
---|