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

Re: cron.daily error



On Wed, 25 Jul 2012 15:06:11 -0600, Bob Proulx wrote:

>Jeff Grossman wrote:
>> I just did a "grep source *" from the /etc/cron.daily directory to
>> figure out what file is causing me the problems.  But, it came back
>> empty.  How would I figure out where that source file is to fix it?
>> The e-mail is my daily cron.daily cron job e-mail that is giving me
>> the error.
>
>If the output was coming from one of the /etc/cron.daily/* scripts
>then the 'run-parts --report' should report the name of it.  This
>leads me to believe that it must be coming from a different crontab.
>There are several possible locations.  All are covered by /etc/cron*
>though so a recursive grep through there would cover all of the
>crontabs.
>
>  grep -r source /etc/cron* /var/spool/cron/crontabs
>
>I would also look for "su" too.
>
>  grep -r su /etc/cron* /var/spool/cron/crontabs
>
>But it could also be in a script that is being called from one of
>those scripts.  In which case you would need to determine which script
>is producing that noise.
>
>I would start by looking at the time of the email.  Then looking in
>/var/log/syslog for a cron task that is running at exactly that same
>time.  There may be some small delays causing the timestamps not to
>line up exactly to the second but usually it is good enough to
>identify a single script.  Line that up with a crontab that runs at
>exactly that time.
>
>If it were from /etc/cron.daily (I don't think it is due to the lack
>of a name reported from run-parts --report) then you could run each
>script individually and look for that error.
>
>The same applies to any task defined in /etc/crontab, /var/spool/cron
>or /etc/cron.d too.  But it is more tedious to do.
>
>The detail that it is calling 'su' makes me think this is a local
>something and not a Debian package.  I don't know of any Debian
>packages that make use of su in a crontab.  That seems unusual since a
>crontab would normally simply declare to be run as the other user.
>There isn't a need for su.  Which leads me to believe that this is a
>local hack.
>
>Bob

Thanks for everybody's help.  I finally figured it out.  It was the
amavisd-new script in the cron.daily directory.  That script called
the amavisd-new-cronjob script in the /usr/sbin directory.  There is
an su line in there.  I changed that script to use bash instead of sh
and now I am not getting the error when I run the script.  I am
assuming I won't receive the e-mail tomorrow when the cron.daily cron
job runs.

Thanks again.

Jeff


Reply to: