FAQ Search Today's Posts Mark Forums Read
» Video Reviews

» Linux Archive

Linux-archive is a website aiming to archive linux email lists and to make them easily accessible for linux users/developers.


» Sponsor

» Partners

» Sponsor

Go Back   Linux Archive > Redhat > Fedora User

 
 
LinkBack Thread Tools
 
Old 01-27-2011, 04:24 PM
Gordon Charrick
 
Default New logwatch module not working in cron

I wrote a new logwatch module for vnstat and put it in
/etc/logwatch/scripts/services. If I run logwatch from the command line,
it works fine. When cron runs it, the vnstat module doesn't run. The
module is extremely simple - all it does is run the vnstat command.
There are no errors being reported. All I get is an empty begin/end
section for vnstat in the email from logwatch.

I know it's not selinux because I originally had problems with that and
I fixed that with a local selinux module for vnstat. I also specifically
have the full path to the vnstat command in the logwatch vnstat script.

Anyone have any clues on fixing this?

Gordon

--
users mailing list
users@lists.fedoraproject.org
To unsubscribe or change subscription options:
https://admin.fedoraproject.org/mailman/listinfo/users
Guidelines: http://fedoraproject.org/wiki/Mailing_list_guidelines
 
Old 01-27-2011, 05:17 PM
Rick Stevens
 
Default New logwatch module not working in cron

On 01/27/2011 09:24 AM, Gordon Charrick wrote:
> I wrote a new logwatch module for vnstat and put it in
> /etc/logwatch/scripts/services. If I run logwatch from the command line,
> it works fine. When cron runs it, the vnstat module doesn't run. The
> module is extremely simple - all it does is run the vnstat command.
> There are no errors being reported. All I get is an empty begin/end
> section for vnstat in the email from logwatch.
>
> I know it's not selinux because I originally had problems with that and
> I fixed that with a local selinux module for vnstat. I also specifically
> have the full path to the vnstat command in the logwatch vnstat script.
>
> Anyone have any clues on fixing this?

Cron jobs do not have the standard path when they run. Odds are the
module (or something it calls) can't be found on cron's limited
path. This can be fixed by putting a

PATH=$PATH:/path1[:/path2]

(where /path1, etc. are the paths you want to include in the search)
after the "#!/bin/bash" at the top of the /etc/cron.daily/0logwatch
file to expand the path that cron has. That, or make sure you use an
absolute path (e.g. "/usr/bin/name-of-program") for each program you're
running in the crontab.
----------------------------------------------------------------------
- Rick Stevens, Systems Engineer, C2 Hosting ricks@nerd.com -
- AIM/Skype: therps2 ICQ: 22643734 Yahoo: origrps2 -
- -
- Lottery: A tax on people who are bad at math. -
----------------------------------------------------------------------
--
users mailing list
users@lists.fedoraproject.org
To unsubscribe or change subscription options:
https://admin.fedoraproject.org/mailman/listinfo/users
Guidelines: http://fedoraproject.org/wiki/Mailing_list_guidelines
 

Thread Tools




All times are GMT. The time now is 10:10 AM.

VBulletin, Copyright ©2000 - 2014, Jelsoft Enterprises Ltd.
Content Relevant URLs by vBSEO ©2007, Crawlability, Inc.
Copyright 2007 - 2008, www.linux-archive.org