LinuxQuestions.org

LinuxQuestions.org (/questions/)
-   Linux - Software (https://www.linuxquestions.org/questions/linux-software-2/)
-   -   Logwatch problem when run from cron (https://www.linuxquestions.org/questions/linux-software-2/logwatch-problem-when-run-from-cron-429946/)

lucktsm 03-30-2006 05:59 AM

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.

gilead 03-30-2006 06:48 AM

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?

sm1else 03-30-2006 07:07 AM

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
replacing SENDMAIL_PATH with the path to sendmail

lucktsm 03-31-2006 06:48 AM

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?

gilead 03-31-2006 01:21 PM

I'd just change it to whatever the full path to postfix is and see if that fixes the problem.

lucktsm 04-05-2006 07:07 PM

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.