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

Re: cron and CRON



On Tue, May 08, 2007 at 05:59:19PM -0300, Valdir Marcos wrote:
> Take a look:
> 
> # pstree
> init---atd
>      +-bash
>      +-cron---firebird
>      ?      +-sendmail
>      +-cron---cron---sendmail
>      ?             +-sh---curl
>      +-dhclient
[snip]

> # ps aux | grep cron
> root     14094  0.0  0.1  1764  820 ?        Ss   00:21   0:00 /usr/sbin/cron
> root     14256  0.0  0.1  1848  708 pts/0    R+   01:42   0:00 grep cron
> r# ps aux | grep CRON
> root     12156  0.0  0.1  2056  936 ?        S    May05   0:00 /USR/SBIN/CRON
> root     14098  0.0  0.1  2056  940 ?        S    00:28   0:00 /USR/SBIN/CRON
> 
> Why is there two processes with "cron"?

According to the manpage for cron(8):
    cron then wakes up every minute, examining all stored crontabs,
    checking  each command to see if it should be run in the current
    minute.  When executing commands, any output is mailed to the
    owner of  the crontab (or to the user named in the MAILTO
    environment variable in the crontab, if such exists).  The children
    copies of  cron  running these processes  have their name coerced to
    uppercase, as will be seen in the syslog and ps output.                 

If you run "pstree -p" you'll probably see that the uppercase'd cron
processes are the ones that spawned your sendmail process.  Although by
the time you read this, that process is probably dead...  But don't be
surprised to see other occurrences of the same...

-- 
Karl E. Jorgensen
karl@jorgensen.org.uk  http://www.jorgensen.org.uk/
karl@jorgensen.com     http://karl.jorgensen.com
==== Today's fortune:
<Crow_> hmm, is there a --now-dammit option for exim?

Attachment: signature.asc
Description: Digital signature


Reply to: