[PLUG] Finding application parent PID?

Rogan Creswick creswick at cs.orst.edu
Mon Jan 26 02:05:03 UTC 2004


On Sun, Jan 25, 2004 at 10:52:15PM -0800, Alex Daniloff wrote:
> > Am I not understanding what you are after?  What characteristic of
> > 'pidof foo' doesn't work?  Examples?
> 
> Here you go:
> pidof /opt/mozilla/mozilla 
> doesn't give any pid but 
> pidof /bin/sh /opt/mozilla/run-mozilla.sh /opt/mozilla/mozilla-bin
> which is some what inconvenient.

$ pidof mozilla-bin
1229 1225 1224 1216

You have to specify the binary apparently.  The -x switch may help
with this, but I'm not certian I understand what it does. (it dosen't
seem to help with the mozilla example).  I suppose this is
inconvenient, but this is reasonably consistent with the way programs
appear in the ps output also.  I don't know of a better way.

It would be nice if pidof took a reg. exp. as a parameter. (or even a
glob..).  A perl wrapper for ps that does the same thing shouldn't be
to difficult.

-Rogan




More information about the PLUG mailing list