FreeBSD 6.0-RC1 available
Brian Candler
B.Candler at pobox.com
Sat Oct 15 01:33:57 PDT 2005
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]
$
More information about the freebsd-current
mailing list