Re: New logwatch module not working in cron

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



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@xxxxxxxx -
- AIM/Skype: therps2        ICQ: 22643734            Yahoo: origrps2 -
-                                                                    -
-           Lottery: A tax on people who are bad at math.            -
----------------------------------------------------------------------
-- 
users mailing list
users@xxxxxxxxxxxxxxxxxxxxxxx
To unsubscribe or change subscription options:
https://admin.fedoraproject.org/mailman/listinfo/users
Guidelines: http://fedoraproject.org/wiki/Mailing_list_guidelines

[Index of Archives]     [Older Fedora Users]     [Fedora Announce]     [Fedora Package Announce]     [EPEL Announce]     [EPEL Devel]     [Fedora Magazine]     [Fedora Summer Coding]     [Fedora Laptop]     [Fedora Cloud]     [Fedora Advisory Board]     [Fedora Education]     [Fedora Security]     [Fedora Scitech]     [Fedora Robotics]     [Fedora Infrastructure]     [Fedora Websites]     [Anaconda Devel]     [Fedora Devel Java]     [Fedora Desktop]     [Fedora Fonts]     [Fedora Marketing]     [Fedora Management Tools]     [Fedora Mentors]     [Fedora Package Review]     [Fedora R Devel]     [Fedora PHP Devel]     [Kickstart]     [Fedora Music]     [Fedora Packaging]     [Fedora SELinux]     [Fedora Legal]     [Fedora Kernel]     [Fedora OCaml]     [Coolkey]     [Virtualization Tools]     [ET Management Tools]     [Yum Users]     [Yosemite News]     [Gnome Users]     [KDE Users]     [Fedora Art]     [Fedora Docs]     [Fedora Sparc]     [Libvirt Users]     [Fedora ARM]

  Powered by Linux