Subject: Re: The new rc.d stuff...
To: None <current-users@netbsd.org>
From: Simon Burge <simonb@netbsd.org>
List: current-users
Date: 03/19/2000 10:07:40
Robert Elz wrote:

>     Date:        Sat, 18 Mar 2000 11:10:06 -0500
>     From:        Mason Loring Bliss <mason@acheron.middleboro.ma.us>
>     Message-ID:  <20000318111006.A1199@acheron.middleboro.ma.us>
> 
> This has nothing to do with the new rc.d and not much to do
> with your scripts, this was just the prompt for something I
> had meant to say for a while ...
> 
> [ ... stuff deleted ... ]
> 
> That "ps ax | grep atalkd | grep -v grep" technique is one I have
> seen many times, and always wondered why
> 
> 	ps axc | grep atalkd
> 
> isn't used instead.  Not only does the 'c' flag eliminate the grep
> much more effeciently than "grep -v grep" does, but it also finds
> the processes, even if they've scribbled on their argv[0].

There's two "gotcha"s to remember with "ps axc" - one is that only the
first MAXCOMLEN (16 characters) of the process name is stored in the
proc structure (this shouldn't be a big problem), and the other is that
the target of a symlink is listed (a good example is "ssh1" instead of
"ssh").

One big benefit is that there's not uid->username translations.  This is
_very_ useful when you used hesiod for usernames and named has taken a
tumble :-)

One thing I've thought about every now and then is should there be an
argument to ps to only list commands where the command name matches a
certain argument.  I guess this is really only one step away from an
skill/killall...

Simon.