Date: Sat, 15 Oct 2005 09:33:48 +0100 From: Brian Candler <B.Candler@pobox.com> To: John Baldwin <jhb@freebsd.org> Cc: Andy Hilker <ah@crypta.net>, freebsd-current@freebsd.org Subject: Re: FreeBSD 6.0-RC1 available Message-ID: <20051015083348.GA23073@uk.tiscali.com> In-Reply-To: <200510141502.16653.jhb@freebsd.org> References: <434BCDF6.3090303@samsco.org> <1129201350.13257.9.camel@myfreebsd.homeunix.org> <20051013155511.GA1748@mail.crypta.net> <200510141502.16653.jhb@freebsd.org>
next in thread | previous in thread | raw e-mail | index | archive | help
On Fri, Oct 14, 2005 at 03:02:15PM -0400, John Baldwin wrote: > > Is it possible to include this minor patch for rc-ng scripts? It > > ist present since 5.3 or earlier... > > > > http://www.freebsd.org/cgi/query-pr.cgi?pr=conf/82430 > > Why does the process name have []'s around it? If the total length of the command line (argv strings) is longer than kern.ps_arg_cache_limit, which defaults to 256, then this is what you'll see. `ps` shows just the command name in [] and no arguments. I've noticed this with courier-imap, for example, which has a very long command line. So I've done sysctl kern.ps_arg_cache_limit=512 on my courier-imap boxes to be able to see the full line. Equally, if you want to demonstrate this to yourself for testing purposes, try setting it to something a lot smaller, and then starting some new processes. I also think that a process which is started with an empty argv[] array will be displayed in this way. See the example below, and paragraph 4.4 at http://www.faqs.org/faqs/unix-faq/faq/part4/ I don't know which case applies to clamav-milter, or maybe there's some other reason - perhaps the OP can confirm. In any case, if a script tries to locate a program's pid using 'ps' output, I think this is certainly a case it needs to deal with. Regards, Brian. ---- 8< ---------------- $ cat ert.c #include <unistd.h> int main(void) { execl("./ert2", 0); return 127; } $ cat ert2.c #include <unistd.h> int main(void) { sleep(20); return 0; } $ gcc -Wall -o ert ert.c $ gcc -Wall -o ert2 ert2.c $ ./ert & $ ps auxwww | grep ert brian 23247 0.0 0.1 1188 468 p2 S 9:30AM 0:00.01 [ert2] $
Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?20051015083348.GA23073>