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

Re: Hanging cron.daily



On Tue, 2001-09-11 at 03:35, BeerBong wrote:
> Hello all!
> 
> Please help to understand where can be a problem.
> I had a following process list at the morning.
> Such things happened from time to time.
> ----------------------------------------------------------------------------
> 22799 ?        SW     0:00  \_ /USR/SBIN/CRON
> 22801 ?        S      0:00      \_ /bin/sh -c test -e /usr/sbin/anacron ||
> run-parts --report /etc/cron.daily 2>&1 | mail -s "[Log]"
> 22808 ?        S      0:00          \_ run-parts --report /etc/cron.daily
> 23051 ?        Z      0:00          |   \_ [exim <defunct>]
> 22809 ?        S      0:00          \_ mail -s [Log] Daily report from Maul
> email@mail.ru
> ----------------------------------------------------------------------------
> /etc/crontab:
> ----------------------------------------------------------------------------
> SHELL=/bin/sh
> PATH=/usr/local/sbin:/usr/local/bin:/sbin:/bin:/usr/sbin:/usr/bin
> 
>  # m h dom mon dow user  command
> 00 9    * * *   root    test -e /usr/sbin/anacron || run-parts --report
> /etc/cron.daily 2>&1 | mail -s "[Log] Daily report from Maul" email@mail.ru
> ----------------------------------------------------------------------------
> 
> cron.daily contains following scripts:
> ----------------------------------------------------------------------------
> maul:/etc/cron.daily# ls
> backup  calendar  exim  find  logrotate  logrotate-webalizer  man-db
> modutils  netbase  proftpd  quota  samba  standard  sysklogd
> ----------------------------------------------------------------------------
> 
> non-standart scripts -
> backup - makes incremental backup  (166 serious web sites)
> (20Mb of gziped changes daily) and copy archive to another computer via
> samba
> 
> I think other scripts does not matter, because they should be executed after
> exim.
> exim is a standart script:
> ----------------------------------------------------------------------------
> maul:/tmp/test# cat /etc/cron.daily/exim
> #!/bin/sh
> 
> # Cycle logs
> if [ -x /usr/bin/savelog ]; then
>   for i in mainlog rejectlog paniclog; do
>     if [ -e /var/log/exim/$i ]; then
>       savelog -u mail -g mail -p -c 10 /var/log/exim/$i >/dev/null
>     fi
>   done
> fi

> Logs are clean.
> When I start exim script manually it executes normally.
> Where problem ?

Try looking at the environment variables your shell has set that the
exim script does not.  Perhaps the paths differ from the script being
run by cron to your manual invocations.

Do you run the script as root or as a normal user when it works?
What shell is /bin/sh linked to?
What shell do you run as a user?

Hopefully one of these questions will help you find the answer.
--mike




Reply to: