aboutsummaryrefslogtreecommitdiffstats
path: root/chapter06/procps.xml
blob: cadbbd64b2c06986496a7591e368f64ec4e172ea (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
261
262
263
264
265
266
267
268
269
270
271
272
273
274
275
276
277
278
279
280
281
282
283
284
<?xml version="1.0" encoding="ISO-8859-1"?>
<!DOCTYPE sect1 PUBLIC "-//OASIS//DTD DocBook XML V4.5//EN"
  "http://www.oasis-open.org/docbook/xml/4.5/docbookx.dtd" [
  <!ENTITY % general-entities SYSTEM "../general.ent">
  %general-entities;
]>

<sect1 id="ch-system-procps" role="wrap">
  <?dbhtml filename="procps-ng.html"?>

  <sect1info condition="script">
    <productname>procps-ng</productname>
    <productnumber>&procps-ng-version;</productnumber>
    <address>&procps-ng-url;</address>
  </sect1info>

  <title>Procps-ng-&procps-ng-version;</title>

  <indexterm zone="ch-system-procps">
    <primary sortas="a-Procps">Procps-ng</primary>
  </indexterm>

  <sect2 role="package">
    <title/>

    <para>The Procps-ng package contains programs for monitoring processes.</para>

    <segmentedlist>
      <segtitle>&buildtime;</segtitle>
      <segtitle>&diskspace;</segtitle>

      <seglistitem>
        <seg>&procps-ng-ch6-sbu;</seg>
        <seg>&procps-ng-ch6-du;</seg>
      </seglistitem>
    </segmentedlist>

  </sect2>

  <sect2 role="installation">
    <title>Installation of Procps-ng</title>

    <para>Now prepare procps-ng for compilation:</para>

<screen><userinput remap="configure">./configure --prefix=/usr                           \
            --exec-prefix=                          \
            --libdir=/usr/lib                       \
            --docdir=/usr/share/doc/procps-ng-&procps-ng-version; \
            --disable-static                        \
            --disable-skill                         \
            --disable-kill</userinput></screen>

    <variablelist>
      <title>The meaning of the configure options:</title>

      <varlistentry>
        <term><parameter>--disable-skill</parameter></term>
        <listitem>
          <para>This switch disables the obsolete and unportable
          skill and snice commands.</para>
        </listitem>
      </varlistentry>
      <varlistentry>
        <term><parameter>--disable-kill</parameter></term>
        <listitem>
          <para>This switch disables building the kill command that
          was installed in the util-linux package.</para>
        </listitem>
      </varlistentry>
    </variablelist>

    <para>Compile the package:</para>

<screen><userinput remap="make">make</userinput></screen>

    <para>The test suite needs some custom modifications for LFS.
    The <command>which</command> command is not available, the
    <command>pmap</command> test does not match a newline character in
    two tests, and the <command>slabtop</command> test may return more than 
    999,999 objects. To run the test suite, run the following commands:</para>

<screen><userinput remap="test">pushd testsuite
  sed -i -e 's|exec which sleep|exec echo /tools/bin/sleep|' \
         -e 's|999999|&amp;9|'                       config/unix.exp
  sed -i -e 's|pmap_initname\\\$|pmap_initname|' pmap.test/pmap.exp
  make site.exp
  DEJAGNU=global-conf.exp runtest
popd</userinput></screen>

    <para>Install the package:</para>

<screen><userinput remap="install">make install</userinput></screen>

<para>Finally move the library to a location that can be found if
<filename class="directory">/usr</filename> is not mounted.</para>

<screen><userinput remap="install">mv -v /usr/lib/libprocps.so.* /lib
ln -sfv ../../lib/libprocps.so.1.1.0 /usr/lib/libprocps.so</userinput></screen>

  </sect2>

  <sect2 id="contents-procps" role="content">
    <title>Contents of Procps-ng</title>

    <segmentedlist>
      <segtitle>Installed programs</segtitle>
      <segtitle>Installed library</segtitle>

      <seglistitem>
        <seg>free, pgrep, pkill, pmap, ps, pwdx, slabtop,
        sysctl, tload, top, uptime, vmstat, w, and, watch</seg>
        <seg>libprocps.so</seg>
      </seglistitem>
    </segmentedlist>

    <variablelist>
      <bridgehead renderas="sect3">Short Descriptions</bridgehead>
      <?dbfo list-presentation="list"?>
      <?dbhtml list-presentation="table"?>

      <varlistentry id="free">
        <term><command>free</command></term>
        <listitem>
          <para>Reports the amount of free and used memory (both physical and
          swap memory) in the system</para>
          <indexterm zone="ch-system-procps free">
            <primary sortas="b-free">free</primary>
          </indexterm>
        </listitem>
      </varlistentry>

      <varlistentry id="pgrep">
        <term><command>pgrep</command></term>
        <listitem>
          <para>Looks up processes based on their name and other attributes</para>
          <indexterm zone="ch-system-procps pgrep">
            <primary sortas="b-pgrep">pgrep</primary>
          </indexterm>
        </listitem>
      </varlistentry>

      <varlistentry id="pkill">
        <term><command>pkill</command></term>
        <listitem>
          <para>Signals processes based on their name and other attributes</para>
          <indexterm zone="ch-system-procps pkill">
            <primary sortas="b-pkill">pkill</primary>
          </indexterm>
        </listitem>
      </varlistentry>

      <varlistentry id="pmap">
        <term><command>pmap</command></term>
        <listitem>
          <para>Reports the memory map of the given process</para>
          <indexterm zone="ch-system-procps pmap">
            <primary sortas="b-pmap">pmap</primary>
          </indexterm>
        </listitem>
      </varlistentry>

      <varlistentry id="ps">
        <term><command>ps</command></term>
        <listitem>
          <para>Lists the current running processes</para>
          <indexterm zone="ch-system-procps ps">
            <primary sortas="b-ps">ps</primary>
          </indexterm>
        </listitem>
      </varlistentry>

      <varlistentry id="pwdx">
        <term><command>pwdx</command></term>
        <listitem>
          <para>Reports the current working directory of a process</para>
          <indexterm zone="ch-system-procps pwdx">
            <primary sortas="b-pwdx">pwdx</primary>
          </indexterm>
        </listitem>
      </varlistentry>

      <varlistentry id="slabtop">
        <term><command>slabtop</command></term>
        <listitem>
          <para>Displays detailed kernel slap cache information in real time</para>
          <indexterm zone="ch-system-procps slabtop">
            <primary sortas="b-slabtop">slabtop</primary>
          </indexterm>
        </listitem>
      </varlistentry>

      <varlistentry id="sysctl">
        <term><command>sysctl</command></term>
        <listitem>
          <para>Modifies kernel parameters at run time</para>
          <indexterm zone="ch-system-procps sysctl">
            <primary sortas="b-sysctl">sysctl</primary>
          </indexterm>
        </listitem>
      </varlistentry>

      <varlistentry id="tload">
        <term><command>tload</command></term>
        <listitem>
          <para>Prints a graph of the current system load average</para>
          <indexterm zone="ch-system-procps tload">
            <primary sortas="b-tload">tload</primary>
          </indexterm>
        </listitem>
      </varlistentry>

      <varlistentry id="top">
        <term><command>top</command></term>
        <listitem>
          <para>Displays a list of the most CPU intensive processes; it
          provides an ongoing look at processor activity in real time</para>
          <indexterm zone="ch-system-procps top">
            <primary sortas="b-top">top</primary>
          </indexterm>
        </listitem>
      </varlistentry>

      <varlistentry id="uptime">
        <term><command>uptime</command></term>
        <listitem>
          <para>Reports how long the system has been running, how many users are
          logged on, and the system load averages</para>
          <indexterm zone="ch-system-procps uptime">
            <primary sortas="b-uptime">uptime</primary>
          </indexterm>
        </listitem>
      </varlistentry>

      <varlistentry id="vmstat">
        <term><command>vmstat</command></term>
        <listitem>
          <para>Reports virtual memory statistics, giving information about
          processes, memory, paging, block Input/Output (IO), traps, and CPU
          activity</para>
          <indexterm zone="ch-system-procps vmstat">
            <primary sortas="b-vmstat">vmstat</primary>
          </indexterm>
        </listitem>
      </varlistentry>

      <varlistentry id="w">
        <term><command>w</command></term>
        <listitem>
          <para>Shows which users are currently logged on, where, and since
          when</para>
          <indexterm zone="ch-system-procps w">
            <primary sortas="b-w">w</primary>
          </indexterm>
        </listitem>
      </varlistentry>

      <varlistentry id="watch">
        <term><command>watch</command></term>
        <listitem>
          <para>Runs a given command repeatedly, displaying the first
          screen-full of its output; this allows a user to watch the output
          change over time</para>
          <indexterm zone="ch-system-procps watch">
            <primary sortas="b-watch">watch</primary>
          </indexterm>
        </listitem>
      </varlistentry>

      <varlistentry id="libprocps">
        <term><filename class="libraryfile">libproc</filename></term>
        <listitem>
          <para>Contains the functions used by most programs in this
          package</para>
          <indexterm zone="ch-system-procps libprocps">
            <primary sortas="c-libprocps">libprocps</primary>
          </indexterm>
        </listitem>
      </varlistentry>

    </variablelist>

  </sect2>

</sect1>