[Date Prev][Date Next] [Thread Prev][Thread Next] [Date Index] [Thread Index]

Re: Wierd 'ps ax' output



On Wed, Feb 20, 2002 at 05:18:21PM -0600, Nathan E Norman wrote:
> On Wed, Feb 20, 2002 at 10:36:22PM +0000, Jonathan Matthews wrote:
> > On Wed, Feb 20, 2002 at 04:20:38PM -0600, Nathan E Norman wrote:
> > > Needlessly worried.  16891 is a child of 186; you can tell because the
> > > process name is in all caps (you could also tell if you did "ps
> > > fax").

After re-reading my original post, I explained poorly what was going
on.  Sorry.

> > > 16892 is the child of 16891; it's the script listed in
> > > /etc/cron.d/exim, which runs every 15 minutes.
> > 
> > Thanks!
> > It was the caps that were bothering me.  I didn't know that
> > this was a property of child processes in 'ps' ... why is
> > it that /all/ processes aren't in caps, being the children
> > of init?  Is it just to differentiate between parent and
> > child where the child is a clone/fork/whatever of the parent?
> 
> It's not a property of ps ... it's a property of cron.  Not in the
> docs of course ... I remember seeing a discussion about it on d-devel
> a while back :)

To further elucidate:

lines 100-108 of do_command.c in the vixie cron sources say

	/* mark ourselves as different to PS command watchers by upshifting
	 * our program name.  This has no effect on some kernels.
	 */
	/*local*/{
		register char	*pch;

		for (pch = ProgramName;  *pch;  pch++)
			*pch = MkUpper(*pch);
	}

This bit happens after the fork as a cron job is about to be executed.

-- 
Nathan Norman - Staff Engineer | A good plan today is better
Micromuse Ltd.                 | than a perfect plan tomorrow.
mailto:nnorman@micromuse.com   |   -- Patton

Attachment: pgpLq2ukeIo5I.pgp
Description: PGP signature


Reply to: