svn commit: r39947 - head/en_US.ISO8859-1/books/handbook/basics

Eitan Adler eadler at FreeBSD.org
Mon Nov 5 13:16:45 UTC 2012


Author: eadler
Date: Mon Nov  5 13:16:45 2012
New Revision: 39947
URL: http://svnweb.freebsd.org/changeset/doc/39947

Log:
  Prefer the use of pgrep instead of ps | grep for exactly the reason
  specified in the handbook: ps is "racy".
  
  Approved by:	jkois

Modified:
  head/en_US.ISO8859-1/books/handbook/basics/chapter.xml

Modified: head/en_US.ISO8859-1/books/handbook/basics/chapter.xml
==============================================================================
--- head/en_US.ISO8859-1/books/handbook/basics/chapter.xml	Mon Nov  5 11:32:14 2012	(r39946)
+++ head/en_US.ISO8859-1/books/handbook/basics/chapter.xml	Mon Nov  5 13:16:45 2012	(r39947)
@@ -2185,20 +2185,12 @@ Swap: 256M Total, 38M Used, 217M Free, 1
 
       <step>
 	<para>Find the process ID of the process you want to send the
-	  signal to.  Do this using &man.ps.1; and &man.grep.1;.  The
-	  &man.grep.1; command is used to search through output,
-	  looking for the string you specify.  This command is run as
-	  a normal user, and &man.inetd.8; is run as
-	  <username>root</username>, so the <option>ax</option>
-	  options must be given to &man.ps.1;.</para>
-
-	<screen>&prompt.user; <userinput>ps -ax | grep inetd</userinput>
-  198  ??  IWs    0:00.00 inetd -wW</screen>
-
-	<para>So the &man.inetd.8; PID is 198.  In some cases the
-	  <literal>grep inetd</literal> command might also appear in
-	  this output.  This is because of the way &man.ps.1; has to
-	  find the list of running processes.</para>
+	  signal to.  Do this using &man.pgrep.1;.</para>
+
+	<screen>&prompt.user; <userinput>pgrep -l inetd</userinput>
+198  inetd -wW</screen>
+
+	<para>So the &man.inetd.8; PID is 198.</para>
       </step>
 
       <step>


More information about the svn-doc-all mailing list