strange ps behaviour

Oliver Fromme olli at lurza.secnetix.de
Tue May 27 11:37:39 UTC 2008


Michael Lednev wrote:
 > Oliver Fromme ?????:
 > > Michael Lednev wrote:
 > > > Oliver Fromme ?????:
 > > > > Michael Lednev wrote:
 > > > > > # pgrep radiusd
 > > > > > 1105
 > > > > > 33738
 > > > > > # ps ax | grep radiusd
 > > > > >  1105  ??  Ss     2:35,76 /usr/local/sbin/radiusd
 > > > > > # ps 33738
 > > > > >   PID  TT  STAT      TIME COMMAND
 > > > > 
 > > > > It seems that the second matching process exited before
 > > > > the ps command was executed.
 > > > 
 > > > It's repeatable.
 > > 
 > > That means that the radiusd process kept forking short-
 > > lived child processes, for whatever reason.
 > 
 > keeping constant PID for children?

OK, you didn't mention that it is the same PID every time.
In that case my first suspicion would be a bug in pgrep.
If it happens again, I suggest you use pgrep -lf.  Maybe
the output gives a hint.

(Also note that ps cuts after 80 columns.  Sometimes the
information you're looking for is after column 80, so I
recommend to always use -ww, especially when the output
is used for matching in scripts.)

Best regards
   Oliver

-- 
Oliver Fromme, secnetix GmbH & Co. KG, Marktplatz 29, 85567 Grafing b. M.
Handelsregister: Registergericht Muenchen, HRA 74606,  Geschäftsfuehrung:
secnetix Verwaltungsgesellsch. mbH, Handelsregister: Registergericht Mün-
chen, HRB 125758,  Geschäftsführer: Maik Bachmann, Olaf Erb, Ralf Gebhart

FreeBSD-Dienstleistungen, -Produkte und mehr:  http://www.secnetix.de/bsd

"A language that doesn't have everything is actually easier
to program in than some that do."
        -- Dennis M. Ritchie


More information about the freebsd-questions mailing list