aboutsummaryrefslogtreecommitdiffstats
path: root/chapter06/psmisc.xml
blob: 18d390a1896e9de38847363fc7c08b3330a96311 (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
<?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-psmisc" role="wrap">
  <?dbhtml filename="psmisc.html"?>

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

  <title>Psmisc-&psmisc-version;</title>

  <indexterm zone="ch-system-psmisc">
    <primary sortas="a-Psmisc">Psmisc</primary>
  </indexterm>

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

    <para>The Psmisc package contains programs for displaying information about
    running processes.</para>

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

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

  </sect2>

  <sect2 role="installation">
    <title>Installation of Psmisc</title>

    <para>Prepare Psmisc for compilation:</para>

<screen><userinput remap="configure">./configure --prefix=/usr --exec-prefix=""</userinput></screen>

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

      <varlistentry>
        <term><parameter>--exec-prefix=""</parameter></term>
        <listitem>
          <para>This ensures that the Psmisc binaries will install into
          <filename class="directory">/bin</filename> instead of <filename
          class="directory">/usr/bin</filename>. This is the correct location
          according to the FHS, because some of the Psmisc binaries are used
          by the LFS-Bootscripts package.</para>
        </listitem>
      </varlistentry>

    </variablelist>

    <para>Compile the package:</para>

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

    <para>This package does not come with a test suite.</para>

    <para>Install the package:</para>

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

    <para>There is no reason for the <command>pstree</command> and
    <command>pstree.x11</command> programs to reside in <filename
    class="directory">/bin</filename>. Therefore, move them to <filename
    class="directory">/usr/bin</filename>:</para>

<screen><userinput remap="install">mv -v /bin/pstree* /usr/bin</userinput></screen>

    <para>By default, Psmisc's <command>pidof</command> program is not
    installed. This usually is not a problem because it is installed later
    in the Sysvinit package, which provides a better
    <command>pidof</command> program. If Sysvinit will not be used for a
    particular system, complete the installation of Psmisc by creating the
    following symlink:</para>

<screen><userinput remap="install">ln -sv killall /bin/pidof</userinput></screen>

  </sect2>

  <sect2 id="contents-psmisc" role="content">
    <title>Contents of Psmisc</title>

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

      <seglistitem>
        <seg>fuser, killall, oldfuser, peekfd, pstree, and pstree.x11
        (link to pstree)</seg>
      </seglistitem>
    </segmentedlist>

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

      <varlistentry id="fuser">
        <term><command>fuser</command></term>
        <listitem>
          <para>Reports the Process IDs (PIDs) of processes that use the given
          files or file systems</para>
          <indexterm zone="ch-system-psmisc fuser">
            <primary sortas="b-fuser">fuser</primary>
          </indexterm>
        </listitem>
      </varlistentry>

      <varlistentry id="killall">
        <term><command>killall</command></term>
        <listitem>
          <para>Kills processes by name; it sends a signal to all processes
          running any of the given commands</para>
          <indexterm zone="ch-system-psmisc killall">
            <primary sortas="b-killall">killall</primary>
          </indexterm>
        </listitem>
      </varlistentry>

      <varlistentry id="oldfuser">
        <term><command>oldfuser</command></term>
        <listitem>
          <para>Reports the Process IDs (PIDs) of processes that use the given
          files or file systems</para>
          <indexterm zone="ch-system-psmisc oldfuser">
            <primary sortas="b-oldfuser">oldfuser</primary>
          </indexterm>
        </listitem>
      </varlistentry>

      <varlistentry id="peekfd">
        <term><command>peekfd</command></term>
        <listitem>
          <para>Peek at file descriptors of a running process, given its
          PID</para>
          <indexterm zone="ch-system-psmisc peekfd">
            <primary sortas="b-peekfd">peekfd</primary>
          </indexterm>
        </listitem>
      </varlistentry>

      <varlistentry id="pstree">
        <term><command>pstree</command></term>
        <listitem>
          <para>Displays running processes as a tree</para>
          <indexterm zone="ch-system-psmisc pstree">
            <primary sortas="b-pstree">pstree</primary>
          </indexterm>
        </listitem>
      </varlistentry>

      <varlistentry id="pstree.x11">
        <term><command>pstree.x11</command></term>
        <listitem>
          <para>Same as <command>pstree</command>, except that it waits for
          confirmation before exiting</para>
          <indexterm zone="ch-system-psmisc pstree.x11">
            <primary sortas="b-pstree.x11">pstree.x11</primary>
          </indexterm>
        </listitem>
      </varlistentry>

    </variablelist>

  </sect2>

</sect1>