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 |
|
---|
7 |
|
---|
8 | <!ENTITY lsof-download-http "https://github.com/lsof-org/lsof/releases/download/&lsof-version;/lsof_&lsof-version;.linux.tar.bz2">
|
---|
9 | <!ENTITY lsof-download-ftp " ">
|
---|
10 | <!ENTITY lsof-md5sum "2a007f86fb0207fbce3e9d7542e1041c">
|
---|
11 | <!ENTITY lsof-size "493 KB">
|
---|
12 | <!ENTITY lsof-buildsize "3.7 MB (add 600 KB for tests)">
|
---|
13 | <!ENTITY lsof-time "less than 0.1 SBU (add 0.4 SBU for tests)">
|
---|
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 |
|
---|
32 | <para>
|
---|
33 | The <application>lsof</application> package is useful to LiSt Open
|
---|
34 | Files for a given running application or process.
|
---|
35 | </para>
|
---|
36 |
|
---|
37 | &lfs110a_checked;
|
---|
38 |
|
---|
39 | <bridgehead renderas="sect3">Package Information</bridgehead>
|
---|
40 | <itemizedlist spacing="compact">
|
---|
41 | <listitem>
|
---|
42 | <para>
|
---|
43 | Download (HTTP): <ulink url="&lsof-download-http;"/>
|
---|
44 | </para>
|
---|
45 | </listitem>
|
---|
46 | <listitem>
|
---|
47 | <para>
|
---|
48 | Download (FTP): <ulink url="&lsof-download-ftp;"/>
|
---|
49 | </para>
|
---|
50 | </listitem>
|
---|
51 | <listitem>
|
---|
52 | <para>
|
---|
53 | Download MD5 sum: &lsof-md5sum;
|
---|
54 | </para>
|
---|
55 | </listitem>
|
---|
56 | <listitem>
|
---|
57 | <para>
|
---|
58 | Download size: &lsof-size;
|
---|
59 | </para>
|
---|
60 | </listitem>
|
---|
61 | <listitem>
|
---|
62 | <para>
|
---|
63 | Estimated disk space required: &lsof-buildsize;
|
---|
64 | </para>
|
---|
65 | </listitem>
|
---|
66 | <listitem>
|
---|
67 | <para>
|
---|
68 | Estimated build time: &lsof-time;
|
---|
69 | </para>
|
---|
70 | </listitem>
|
---|
71 | </itemizedlist>
|
---|
72 |
|
---|
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 |
|
---|
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 |
|
---|
87 | <para condition="html" role="usernotes">User Notes:
|
---|
88 | <ulink url="&blfs-wiki;/lsof"/></para>
|
---|
89 |
|
---|
90 | </sect2>
|
---|
91 |
|
---|
92 | <sect2 role="kernel" id="lsof-kernel">
|
---|
93 | <title>Kernel Configuration</title>
|
---|
94 |
|
---|
95 | <para>
|
---|
96 | To run the tests, the following option should be enabled in the kernel
|
---|
97 | configuration:
|
---|
98 | </para>
|
---|
99 |
|
---|
100 | <screen><literal>General setup --->
|
---|
101 | [*] POSIX Message Queues [CONFIG_POSIX_MQUEUE]</literal></screen>
|
---|
102 |
|
---|
103 | </sect2>
|
---|
104 |
|
---|
105 | <sect2 role="installation">
|
---|
106 | <title>Installation of lsof</title>
|
---|
107 |
|
---|
108 | <para>
|
---|
109 | Install <application>lsof</application> by running the
|
---|
110 | following commands:
|
---|
111 | </para>
|
---|
112 |
|
---|
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>
|
---|
126 |
|
---|
127 | <para>
|
---|
128 | Two tests fail if the tests are run from a script instead of an
|
---|
129 | interactive session.
|
---|
130 | </para>
|
---|
131 |
|
---|
132 | <para>
|
---|
133 | Now, as the <systemitem class="username">root</systemitem> user:
|
---|
134 | </para>
|
---|
135 |
|
---|
136 | <screen role="root"><userinput>install -v -m4755 -o root -g root lsof /usr/bin &&
|
---|
137 | install -v lsof.8 /usr/share/man/man8</userinput></screen>
|
---|
138 |
|
---|
139 | </sect2>
|
---|
140 |
|
---|
141 | <sect2 role="commands">
|
---|
142 | <title>Command Explanations</title>
|
---|
143 |
|
---|
144 | <para>
|
---|
145 | <command>./Configure -n linux</command>: Avoid AFS, customization, and
|
---|
146 | inventory checks, and use the linux dialect.
|
---|
147 | </para>
|
---|
148 |
|
---|
149 | <para>
|
---|
150 | <command>install -m4755 ...</command>: <command>lsof</command> should
|
---|
151 | be suid root to allwo users to list all files. This may be a security
|
---|
152 | threat on some systems. In that case change to <option>-m755</option>
|
---|
153 | and use <command>sudo</command> to run the program.
|
---|
154 | </para>
|
---|
155 |
|
---|
156 | </sect2>
|
---|
157 |
|
---|
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>
|
---|
181 | <para>
|
---|
182 | lists open files for running processes
|
---|
183 | </para>
|
---|
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>
|
---|