Logwatch on CentOS 5.3 64bit

aquila

Verified User
Joined
Jul 2, 2007
Messages
63
Hello,

I have a sever that runs on centos 5.3 64 bit. The default installation did not come with logwatch and I had to yum it. Now that it is installed, I don't receive any emails everyday (although it is configured to). I then found that none of the daily, weekly, monthly crons worked. I realized I did not have anacron installed.

I then yumed anacron as well. Anacron is installed now. It never runs though. I did a service anacron start. It runs for a few hours and sends a logwatch email (without any content) and then somehow dies off.

I know this must be a stupid question, but why isn't my daily, weekly,monthly cron jobs not running? How can I get logwatch to work properly? What do I need to do to make anacron run successfully?

Thanks in advance.
 
I know this must be a stupid question, but why isn't my daily, weekly,monthly cron jobs not running?
Because your crond daemon isn't running.
How can I get logwatch to work properly?
Fix crond.
What do I need to do to make anacron run successfully?
This is a question for a CentOS specific forum or mailing list.

Jeff
 
Thanks Jeff,
My crond is always running. It also runs whatever is listed on crontab
Code:
]# ps -aux | grep crond
Warning: bad syntax, perhaps a bogus '-'? See /usr/share/doc/procps-3.2.7/FAQ
root      5432  0.0  0.0  19712   824 ?        Ss   Jun09   0:04 crond
root     20794  0.0  0.0   6056   612 pts/0    R+   09:17   0:00 grep crond
root     28885  0.0  0.1  46892  1196 ?        S    05:00   0:00 crond

Only thing that don't work is what listed under daily/monthly/weekly

Code:
]# ls /etc/cron*
/etc/cron.deny  /etc/crontab  /etc/crontab.rpmnew

/etc/cron.d:
csf_update  csfcron.sh  directadmin_cron  installatron  lfdcron.sh  refresh.apf

/etc/cron.daily:
0anacron  0logwatch  chkrootkit.sh  freshclam  logrotate  makewhatis.cron  mlocate.cron  prelink  rkhunter.sh  rpm

/etc/cron.hourly:

/etc/cron.monthly:
0anacron

/etc/cron.weekly:
0anacron  makewhatis.cron

What else do you think I'm missing?

Thanks.
 
Check your /etc/crontab file, since you say it is running whatever is in it make sure it has the following:
Code:
# run-parts
01 * * * * root run-parts /etc/cron.hourly
02 4 * * * root run-parts /etc/cron.daily
22 4 * * 0 root run-parts /etc/cron.weekly
42 4 1 * * root run-parts /etc/cron.monthly

If you see it has this, try running run-parts as root in your ssh terminal to see if it is working. When I run it I get:
Code:
[root@tx-1 ~]# run-parts
Usage: run-parts <dir>
If you see something else, your run-parts program may not be working correctly which is stopping the other cron tasks from running.

Also, try checking /var/log/cron to see if there are any errors being reported in the logs.
 
Marshall,

Thanks for the reply. I checked my /etc/crontab and it was empty. I added the lines you have mentioned.

Code:
# cat /etc/crontab
# run-parts
01 * * * * root run-parts /etc/cron.hourly
02 4 * * * root run-parts /etc/cron.daily
22 4 * * 0 root run-parts /etc/cron.weekly
42 4 1 * * root run-parts /etc/cron.monthly

When I ran run-parts I get the following:

Code:
# run-parts
Usage: run-parts <dir>

/var/log/cron - doesn't show any error. Is everything alrgiht now?
 
Hm, it was completely empty? You may also need this at the top, above everything else in the crontab file:
Code:
SHELL=/bin/sh
PATH=/sbin:/bin:/usr/sbin:/usr/bin
MAILTO=root
HOME=/
This should be enough to make it work, best way to know for sure is if you receive the logwatch email sometime tonight.
 
Yes, it was completely empty. I've now added those lines on the top. I will wait and see if I receive the logwatch email in sometime. I will let you know. Thanks again.
 
Back
Top