From owner-freebsd-questions@FreeBSD.ORG Thu Mar 8 07:21:33 2007 Return-Path: X-Original-To: freebsd-questions@freebsd.org Delivered-To: freebsd-questions@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [69.147.83.52]) by hub.freebsd.org (Postfix) with ESMTP id 530A016A409 for ; Thu, 8 Mar 2007 07:21:33 +0000 (UTC) (envelope-from chad@shire.net) Received: from hobbiton.shire.net (mail.shire.net [166.70.252.250]) by mx1.freebsd.org (Postfix) with ESMTP id 3A39013C48E for ; Thu, 8 Mar 2007 07:21:33 +0000 (UTC) (envelope-from chad@shire.net) Received: from [67.171.127.191] (helo=[192.168.99.68]) by hobbiton.shire.net with esmtpsa (TLSv1:AES128-SHA:128) (Exim 4.51) id 1HPCwO-000BnI-G5 for freebsd-questions@freebsd.org; Thu, 08 Mar 2007 00:21:32 -0700 Mime-Version: 1.0 (Apple Message framework v752.2) In-Reply-To: References: <5A82D35B-AF37-4D57-B4DF-D90CFA9C84E6@shire.net> Content-Type: text/plain; charset=US-ASCII; delsp=yes; format=flowed Message-Id: Content-Transfer-Encoding: 7bit From: "Chad Leigh -- Shire.Net LLC" Date: Thu, 8 Mar 2007 00:21:31 -0700 To: User Questions X-Mailer: Apple Mail (2.752.2) X-SA-Exim-Connect-IP: 67.171.127.191 X-SA-Exim-Mail-From: chad@shire.net X-SA-Exim-Scanned: No (on hobbiton.shire.net); SAEximRunCond expanded to false Subject: Re: ps showing [appname] for some things -- how to get whole thing? X-BeenThere: freebsd-questions@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: User questions List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Thu, 08 Mar 2007 07:21:33 -0000 On Mar 7, 2007, at 11:34 AM, Chuck Swiger wrote: > On Mar 7, 2007, at 2:49 AM, Chad Leigh -- Shire.Net LLC wrote: >> On my 6.1 system I have a script that launches some java programs >> [jdk142] and when I do a "ps -auxwww" I get the whole java command >> line that was used in launching. >> >> On my 6.2 system with jdk15 teh scame scripts launch the same java >> programs but I just get [java] in the ps output. Nothing in the >> ps manpage jumped out at me. I would like to be able to get the >> whole commandline when I do the ps > > From the manpage: > > When printing using the command keyword, a process that has > exited and > has a parent that has not yet waited for the process (in other > words, a > zombie) is listed as ``'', and a process which is > blocked while > trying to exit is listed as ``''. If the command > vector cannot > be located (usually because it has not been set, as is the > case of system > processes and/or kernel threads) the command name is printed > within > square brackets. The ps utility makes an educated guess as to > the file > name and arguments given when the process was created by > examining memory > or the swap area. The method is inherently somewhat > unreliable and in > any event a process is entitled to destroy this information, > so the names > cannot be depended on too much. The ucomm (accounting) > keyword can, how- > ever, be depended on. > > In other words, the process is allowed to over-write the > environment (aka, the command line args & exported env variables) > and that will prevent ps from reliably returning that info. All > you can be sure of it getting argv[0], which is used for accounting > in the ucomm variable.... It turns out the difference between my two installations is that with the jdk142 procfs is also mounted and ps shows the complete command. On the server with jdk15 procfs is not mounted and does not. jdk15 also has an issue if procfs is mounted such that the java command does not work. But I am running inside a jail so I could mount procfs on the base server outside the jail and do ps there and test this. These tests show that the procfs makes the difference. Chad --- Chad Leigh -- Shire.Net LLC Your Web App and Email hosting provider chad at shire.net