aboutsummaryrefslogtreecommitdiffstats
path: root/chapter06/psmisc.xml
blob: 0e3383fa2c55234e7a0859fc7035c2d1657ade03 (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
<?xml version="1.0" encoding="ISO-8859-1"?>
<!DOCTYPE sect1 PUBLIC "-//OASIS//DTD DocBook XML V4.3//EN" "http://www.oasis-open.org/docbook/xml/4.3/docbookx.dtd" [
  <!ENTITY % general-entities SYSTEM "../general.ent">
  %general-entities;
]>
<sect1 id="ch-system-psmisc" xreflabel="Psmisc" role="wrap">
<title>Psmisc-&psmisc-version;</title>
<?dbhtml filename="psmisc.html"?>

<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 on
processes.</para>

<segmentedlist>
<segtitle>&buildtime;</segtitle>
<segtitle>&diskspace;</segtitle>
<seglistitem><seg>0.1 SBU</seg><seg>2.2 MB</seg></seglistitem>
</segmentedlist>

<segmentedlist>
<segtitle>Psmisc installation depends on</segtitle>
<seglistitem><seg>Bash, Binutils, Coreutils, Diffutils,
GCC, Gettext, Glibc, Grep, Make, Ncurses, Sed</seg></seglistitem>
</segmentedlist>
</sect2>

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

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

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

<para>The meaning of the configure option:</para>

<variablelist>
<varlistentry>
<term><userinput>--exec-prefix=""</userinput></term>
<listitem><para>This causes the
binaries to be installed in <filename>/bin</filename> instead of
<filename>/usr/bin</filename>. As the Psmisc programs are often used in
bootscripts, they should be available also when the <filename>/usr</filename>
file system isn't mounted.</para></listitem>
</varlistentry>
</variablelist>

<para>Compile the package:</para>

<screen><userinput>make</userinput></screen>

<para>Now install it:</para>

<screen><userinput>make install</userinput></screen>

<para>There is no reason for the <filename>pstree</filename> and
<filename>pstree.x11</filename> programs to reside in
<filename class="directory">/bin</filename>. We therefore move them to
<filename class="directory">/usr/bin</filename>. Also, there is no need
for <filename>pstree.x11</filename> to exist as a separate program. We
therefore make it a symbolic link to <filename>pstree</filename>:</para>

<screen><userinput>mv /bin/pstree* /usr/bin
ln -sf pstree /usr/bin/pstree.x11</userinput></screen>

<para>By default Psmisc's <command>pidof</command> program isn't installed.
Generally, this isn't a problem because we later install the Sysvinit package,
which provides a better <command>pidof</command> program. But if you're not
going to use Sysvinit, you should complete the installation of Psmisc by
creating the following symlink:</para>

<screen><userinput>ln -s 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, pstree and pstree.x11 (link to pstree)</seg></seglistitem>
</segmentedlist>

<variablelist><title>Short descriptions</title>

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

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

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

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

</sect2>

</sect1>