Fedora Linux Support Community & Resources Center
  #1  
Old 19th December 2006, 10:21 PM
Vieira Offline
Registered User
 
Join Date: Aug 2005
Posts: 19
Logwatch Problems

I created a cron job with the following command:
Code:
/usr/share/logwatch/scripts/logwatch.pl
and it appears to run fine, however this errors occurs:
Code:
Can't exec "sendmail": No such file or directory at /usr/share/logwatch/scripts/logwatch.pl line 941, <TESTFILE> line 3.
Logwatch is configured to send a report to my email. When I run logwatch manually it sends the mail, however with the cron job it doesn't.
Any sugestions? Thanks in advance.
Reply With Quote
  #2  
Old 19th December 2006, 11:53 PM
digen Offline
Registered User
 
Join Date: Apr 2006
Posts: 33
Can you paste the entire cron job here ?
Reply With Quote
  #3  
Old 20th December 2006, 12:43 AM
Vieira Offline
Registered User
 
Join Date: Aug 2005
Posts: 19
crontab -u root -e
Code:
59 5 * * 1,5 /etc/webmin/time/sync.pl #The Webmin Clock Sync
@weekly /usr/share/logwatch/scripts/logwatch.pl #The Logwatch Perl Script...
Reply With Quote
  #4  
Old 20th December 2006, 01:09 AM
AlexThomson_NZ's Avatar
AlexThomson_NZ Offline
Registered User
 
Join Date: Nov 2006
Posts: 192
A bit of a guess, but maybe sendmail isn't on the user's path when running as a crob job? Maybe try fully qualifying the path to the executable. Can you post line 941 of your logwatch.pl file (where I assume it is trying to execute sendmail)
Reply With Quote
  #5  
Old 20th December 2006, 12:20 PM
Vieira Offline
Registered User
 
Join Date: Aug 2005
Posts: 19
The Code...

Line 932 to 944.
Code:
   if ($Config{'print'} eq 1) {
      *OUTFILE = *STDOUT;
   } elsif ($Config{'save'} ne "") {
      open(OUTFILE,">" . $Config{'save'}) or die "Can't open output file: $Config{'save'} $!\n";
   } else {
      if (($Config{'multiemail'} eq 1) || ($emailopen eq "")) {
         #Use mailer = in logwatch.conf to set options. Default should be "sendmail -t"
         #In theory this should be able to handle many different mailers. I might need to add
         #some filter code on $Config{'mailer'} to make it more robust. -mgt
         open(OUTFILE,"|$Config{'mailer'}") or die "Can't execute $Config{'mailer'}: $!\n";
         print OUTFILE "To: $Config{'mailto'}\n";
         print OUTFILE "From: $Config{'mailfrom'}\n";
         print OUTFILE "Subject: Logwatch for $Config{'hostname'} (${OStitle})\n";
and in the logwatch.conf
Code:
# By default we assume that all Unix systems have sendmail or a sendmail-like system.
# The mailer code Prints a header with To: From: and Subject:.
# At this point you can change the mailer to any thing else that can handle that output
# stream. TODO test variables in the mailer string to see if the To/From/Subject can be set
# From here with out breaking anything. This would allow mail/mailx/nail etc..... -mgt 
mailer = "sendmail -t"
Sendmail is not installed, but postfix is and the server is sending mail fine with the sendmail command. Sorry for my bad english.
Thanks for your replies.

Last edited by Vieira; 20th December 2006 at 12:23 PM.
Reply With Quote
  #6  
Old 7th January 2007, 10:23 PM
ms1234's Avatar
ms1234 Offline
Registered User
 
Join Date: Apr 2005
Posts: 323
Check with whereis sendmail (should be in /usr/sbin/) and edit the config file to include the path.
Reply With Quote
  #7  
Old 13th January 2007, 04:47 PM
Vieira Offline
Registered User
 
Join Date: Aug 2005
Posts: 19
Thumbs up Thank you

Quote:
Originally Posted by ms1234
Check with whereis sendmail (should be in /usr/sbin/) and edit the config file to include the path.
It solved the problem. Thank you very much for your help.
Reply With Quote
Reply

Tags
logwatch, problems

Thread Tools Search this Thread
Search this Thread:

Advanced Search
Display Modes

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off

Forum Jump

Similar Threads
Thread Thread Starter Forum Replies Last Post
Logwatch reports empty!! how to debug logwatch? paul sanz Using Fedora 1 26th June 2008 10:29 AM
Logwatch - where to find help to diagnose problems? spaceman Using Fedora 1 14th May 2004 02:41 AM


Current GMT-time: 18:29 (Wednesday, 19-06-2013)

TopSubscribe to XML RSS for all Threads in all ForumsFedoraForumDotOrg Archive
logo

All trademarks, and forum posts in this site are property of their respective owner(s).
FedoraForum.org is privately owned and is not directly sponsored by the Fedora Project or Red Hat, Inc.

Privacy Policy | Term of Use | Posting Guidelines | Archive | Contact Us | Founding Members

Powered by vBulletin® Copyright ©2000 - 2012, vBulletin Solutions, Inc.

FedoraForum is Powered by RedHat