1
0

procps.xml 9.7 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291
  1. <?xml version="1.0" encoding="UTF-8"?>
  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. <sect1 id="ch-system-procps" role="wrap">
  8. <?dbhtml filename="procps-ng.html"?>
  9. <sect1info condition="script">
  10. <productname>procps-ng</productname>
  11. <productnumber>&procps-ng-version;</productnumber>
  12. <address>&procps-ng-url;</address>
  13. </sect1info>
  14. <title>Procps-ng-&procps-ng-version;</title>
  15. <indexterm zone="ch-system-procps">
  16. <primary sortas="a-Procps">Procps-ng</primary>
  17. </indexterm>
  18. <sect2 role="package">
  19. <title/>
  20. <para>Procps-ng 软件包包含监视进程的程序。</para>
  21. <segmentedlist>
  22. <segtitle>&buildtime;</segtitle>
  23. <segtitle>&diskspace;</segtitle>
  24. <seglistitem>
  25. <seg>&procps-ng-ch6-sbu;</seg>
  26. <seg>&procps-ng-ch6-du;</seg>
  27. </seglistitem>
  28. </segmentedlist>
  29. </sect2>
  30. <sect2 role="installation">
  31. <title>安装 Procps-ng</title>
  32. <para>准备安装 procps-ng:</para>
  33. <screen revision="sysv"><userinput remap="configure">./configure --prefix=/usr \
  34. --exec-prefix= \
  35. --libdir=/usr/lib \
  36. --docdir=/usr/share/doc/procps-ng-&procps-ng-version; \
  37. --disable-static \
  38. --disable-kill</userinput></screen>
  39. <screen revision="systemd"><userinput remap="configure">./configure --prefix=/usr \
  40. --exec-prefix= \
  41. --libdir=/usr/lib \
  42. --docdir=/usr/share/doc/procps-ng-&procps-ng-version; \
  43. --disable-static \
  44. --disable-kill \
  45. --with-systemd</userinput></screen>
  46. <variablelist>
  47. <title>配置选项的含义:</title>
  48. <varlistentry>
  49. <term><parameter>--disable-kill</parameter></term>
  50. <listitem>
  51. <para>该选项禁用 <command>kill</command> 命令的构建,
  52. Util-linux 软件包将安装它。</para>
  53. </listitem>
  54. </varlistentry>
  55. </variablelist>
  56. <para>编译该软件包:</para>
  57. <screen><userinput remap="make">make</userinput></screen>
  58. <!--para>The test suite needs some custom modifications for LFS.
  59. Remove a test that fails when scripting does not use a tty device and
  60. fix two others.
  61. To run the test suite, run the following commands:</para-->
  62. <para>在 LFS 系统上,测试套件需要一些自定义修改。
  63. 删除一个在没有使用 tty 设备输入时会失败的测试,并修正另外两个。
  64. 执行以下命令运行测试套件:</para>
  65. <screen><userinput remap="test">sed -i -r 's|(pmap_initname)\\\$|\1|' testsuite/pmap.test/pmap.exp
  66. sed -i '/set tty/d' testsuite/pkill.test/pkill.exp
  67. rm testsuite/pgrep.test/pgrep.exp
  68. make check</userinput></screen>
  69. <para>安装该软件包:</para>
  70. <screen><userinput remap="install">make install</userinput></screen>
  71. <para>最后,将必要的库移动到
  72. <filename class="directory">/usr</filename> 尚未挂载时也能访问的位置:
  73. </para>
  74. <screen><userinput remap="install">mv -v /usr/lib/libprocps.so.* /lib
  75. ln -sfv ../../lib/$(readlink /usr/lib/libprocps.so) /usr/lib/libprocps.so</userinput></screen>
  76. </sect2>
  77. <sect2 id="contents-procps" role="content">
  78. <title>Procps-ng 的内容</title>
  79. <segmentedlist>
  80. <segtitle>安装的程序</segtitle>
  81. <segtitle>安装的库</segtitle>
  82. <segtitle>安装的目录</segtitle>
  83. <seglistitem>
  84. <seg>free, pgrep, pidof, pkill, pmap, ps, pwdx, slabtop,
  85. sysctl, tload, top, uptime, vmstat, w, 以及 watch</seg>
  86. <seg>libprocps.so</seg>
  87. <seg>/usr/include/proc 和 /usr/share/doc/procps-ng-&procps-ng-version;</seg>
  88. </seglistitem>
  89. </segmentedlist>
  90. <variablelist>
  91. <bridgehead renderas="sect3">简要描述</bridgehead>
  92. <?dbfo list-presentation="list"?>
  93. <?dbhtml list-presentation="table"?>
  94. <varlistentry id="free">
  95. <term><command>free</command></term>
  96. <listitem>
  97. <para>报告系统中可用和已用内存(包括物理内存和交换空间)
  98. 的容量</para>
  99. <indexterm zone="ch-system-procps free">
  100. <primary sortas="b-free">free</primary>
  101. </indexterm>
  102. </listitem>
  103. </varlistentry>
  104. <varlistentry id="pgrep">
  105. <term><command>pgrep</command></term>
  106. <listitem>
  107. <para>根据名称和其他属性查找进程</para>
  108. <indexterm zone="ch-system-procps pgrep">
  109. <primary sortas="b-pgrep">pgrep</primary>
  110. </indexterm>
  111. </listitem>
  112. </varlistentry>
  113. <varlistentry id="pidof">
  114. <term><command>pidof</command></term>
  115. <listitem>
  116. <para>报告给定程序的 PID</para>
  117. <indexterm zone="ch-system-procps pidof">
  118. <primary sortas="b-pidof">pidof</primary>
  119. </indexterm>
  120. </listitem>
  121. </varlistentry>
  122. <varlistentry id="pkill">
  123. <term><command>pkill</command></term>
  124. <listitem>
  125. <para>根据名称和其他属性向进程发送信号</para>
  126. <indexterm zone="ch-system-procps pkill">
  127. <primary sortas="b-pkill">pkill</primary>
  128. </indexterm>
  129. </listitem>
  130. </varlistentry>
  131. <varlistentry id="pmap">
  132. <term><command>pmap</command></term>
  133. <listitem>
  134. <para>报告给定进程的内存映射</para>
  135. <indexterm zone="ch-system-procps pmap">
  136. <primary sortas="b-pmap">pmap</primary>
  137. </indexterm>
  138. </listitem>
  139. </varlistentry>
  140. <varlistentry id="ps">
  141. <term><command>ps</command></term>
  142. <listitem>
  143. <para>列出正在运行的进程</para>
  144. <indexterm zone="ch-system-procps ps">
  145. <primary sortas="b-ps">ps</primary>
  146. </indexterm>
  147. </listitem>
  148. </varlistentry>
  149. <varlistentry id="pwdx">
  150. <term><command>pwdx</command></term>
  151. <listitem>
  152. <para>报告一个进程的当前工作目录</para>
  153. <indexterm zone="ch-system-procps pwdx">
  154. <primary sortas="b-pwdx">pwdx</primary>
  155. </indexterm>
  156. </listitem>
  157. </varlistentry>
  158. <varlistentry id="slabtop">
  159. <term><command>slabtop</command></term>
  160. <listitem>
  161. <para>实时显示内核 slab 缓存详细信息</para>
  162. <indexterm zone="ch-system-procps slabtop">
  163. <primary sortas="b-slabtop">slabtop</primary>
  164. </indexterm>
  165. </listitem>
  166. </varlistentry>
  167. <varlistentry id="sysctl">
  168. <term><command>sysctl</command></term>
  169. <listitem>
  170. <para>在运行时修改内核参数</para>
  171. <indexterm zone="ch-system-procps sysctl">
  172. <primary sortas="b-sysctl">sysctl</primary>
  173. </indexterm>
  174. </listitem>
  175. </varlistentry>
  176. <varlistentry id="tload">
  177. <term><command>tload</command></term>
  178. <listitem>
  179. <para>打印当前系统平均负载示意图</para>
  180. <indexterm zone="ch-system-procps tload">
  181. <primary sortas="b-tload">tload</primary>
  182. </indexterm>
  183. </listitem>
  184. </varlistentry>
  185. <varlistentry id="top">
  186. <term><command>top</command></term>
  187. <listitem>
  188. <para>列出 CPU 占用最大的进程列表;
  189. 它实时地提供处理器活动的连续概况</para>
  190. <indexterm zone="ch-system-procps top">
  191. <primary sortas="b-top">top</primary>
  192. </indexterm>
  193. </listitem>
  194. </varlistentry>
  195. <varlistentry id="uptime">
  196. <term><command>uptime</command></term>
  197. <listitem>
  198. <para>报告系统运行时间、登录用户数目和系统平均负载</para>
  199. <indexterm zone="ch-system-procps uptime">
  200. <primary sortas="b-uptime">uptime</primary>
  201. </indexterm>
  202. </listitem>
  203. </varlistentry>
  204. <varlistentry id="vmstat">
  205. <term><command>vmstat</command></term>
  206. <listitem>
  207. <para>报告虚拟内存统计,给出进程、内存、分页、块输入输出(IO)、
  208. 陷阱和 CPU 活动信息</para>
  209. <indexterm zone="ch-system-procps vmstat">
  210. <primary sortas="b-vmstat">vmstat</primary>
  211. </indexterm>
  212. </listitem>
  213. </varlistentry>
  214. <varlistentry id="w">
  215. <term><command>w</command></term>
  216. <listitem>
  217. <para>显示当前登录用户和它们的登录地点、时间</para>
  218. <indexterm zone="ch-system-procps w">
  219. <primary sortas="b-w">w</primary>
  220. </indexterm>
  221. </listitem>
  222. </varlistentry>
  223. <varlistentry id="watch">
  224. <term><command>watch</command></term>
  225. <listitem>
  226. <para>重复执行给定命令,显示其输出的第一页;
  227. 这使得用户可以观察输出随时间的变化</para>
  228. <indexterm zone="ch-system-procps watch">
  229. <primary sortas="b-watch">watch</primary>
  230. </indexterm>
  231. </listitem>
  232. </varlistentry>
  233. <varlistentry id="libprocps">
  234. <term><filename class="libraryfile">libprocps</filename></term>
  235. <listitem>
  236. <para>包含该软件包大多数程序使用的函数</para>
  237. <indexterm zone="ch-system-procps libprocps">
  238. <primary sortas="c-libprocps">libprocps</primary>
  239. </indexterm>
  240. </listitem>
  241. </varlistentry>
  242. </variablelist>
  243. </sect2>
  244. </sect1>