Logwatch problem when run from cron
Hi all,
I have a strange one here, this just started failing after a logwatch update for FC4. I get this message in when this is run from cron: Can't exec "sendmail": No such file or directory at /usr/sbin/logwatch line 941, <TESTFILE> line 3. Can't execute sendmail -t: No such file or directory Here's the crontab entry, and when I run it manually it works. Any ideas? 0 4 * * * /usr/sbin/logwatch --detail=high --mailto=myemail@myaddress.com Any help would be much appreciated. I don't run sendmail, I use postfix if this helps. |
It sounds like the update overwrote the logwatch.conf file (on my system it's in /etc/log.d/conf/logwatch.conf). What is the mailer set to in your conf file?
|
I'm not sure this will help but one thing to be aware of is that the environment that cron uses to execute tasks is (mostly) empty. You might find that logwatch is assuming that sendmail is in the path but PATH isnt set.
Try putting this at the top of your crontab and see if it works then: Code:
PATH=SENDMAIL_PATH |
I noticed in the logwatch.conf it has sendmail as the defaul mailer it uses sendmail -t. Since I am usung postfix, what should the default mailer be? Or should I commnet out that line?
|
I'd just change it to whatever the full path to postfix is and see if that fixes the problem.
|
Thanks..
That fixed it. Once it had the correct path to sendmail it worked like a champ.
|
All times are GMT -5. The time now is 05:52 PM. |