LinuxQuestions.org
Review your favorite Linux distribution.
Home Forums Tutorials Articles Register
Go Back   LinuxQuestions.org > Forums > Linux Forums > Linux - Server
User Name
Password
Linux - Server This forum is for the discussion of Linux Software used in a server related context.

Notices


Reply
  Search this Thread
Old 06-09-2010, 11:47 AM   #1
DennisC31
Member
 
Registered: May 2007
Location: beyond my means
Distribution: Mint 11.04
Posts: 55

Rep: Reputation: 19
Mystery Cron Job


I have a process that is running every 5 minutes and I do not know where it coming from. Its the vnstat program that gathers network statistics.

I have checked /etc/crontab and /var/spool/cron for any user jobs that may be there and come up empty handed. Do you guys have any idea where this is running from?

Below you can see that I captured the job running as the user nobody (its the vnstat program).

[root@sirius ~]# date
Wed Jun 9 12:25:48 EDT 2010
[root@sirius ~]# while ((1));do ps -ef|grep vnstat|grep -v grep;done
nobody 14035 14033 0 12:30 ? 00:00:00 [vnstat.cron] <defunct>
nobody 27052 27051 0 12:35 ? 00:00:00 /bin/sh -c /usr/sbin/vnstat.cron
nobody 27052 27051 0 12:35 ? 00:00:00 [vnstat.cron] <defunct>
nobody 27052 27051 4 12:35 ? 00:00:00 [vnstat.cron] <defunct>
nobody 7887 7885 0 12:40 ? 00:00:00 /bin/bash /usr/sbin/vnstat.cron
nobody 7888 7887 0 12:40 ? 00:00:00 /usr/bin/vnstat -u -i eth0
nobody 7887 7885 0 12:40 ? 00:00:00 [vnstat.cron] <defunct>
nobody 7887 7885 0 12:40 ? 00:00:00 [vnstat.cron] <defunct>
nobody 7887 7885 0 12:40 ? 00:00:00 [vnstat.cron] <defunct>
nobody 21474 21473 0 12:45 ? 00:00:00 [vnstat.cron] <defunct>
nobody 21474 21473 0 12:45 ? 00:00:00 [vnstat.cron] <defunct>
nobody 21474 21473 0 12:45 ? 00:00:00 [vnstat.cron] <defunct>


You have new mail in /var/spool/mail/root
[root@sirius ~]# ls -l /var/spool/cron/
total 4
-rw------- 1 dcomeaux root 77 Apr 26 08:46 dcomeaux
-rw------- 1 root root 0 Jun 9 11:56 root
[root@sirius ~]# cat /var/spool/cron/*
#* * * * * ls -l /home/dcomeaux 2>&1 1> ~/foo.$(date +\%Y.\%m\%d.\%H\%M.log)
[root@sirius ~]# cat /etc/crontab
SHELL=/bin/bash
PATH=/sbin:/bin:/usr/sbin:/usr/bin
MAILTO=root
HOME=/

# run-parts
01 * * * * root run-parts /etc/cron.hourly
02 4 * * * root run-parts /etc/cron.daily
22 4 * * 0 root run-parts /etc/cron.weekly
42 4 1 * * root run-parts /etc/cron.monthly
[root@sirius ~]#

Last edited by DennisC31; 04-11-2012 at 05:27 PM.
 
Old 06-09-2010, 11:58 AM   #2
ComradeP
LQ Newbie
 
Registered: Oct 2009
Posts: 12

Rep: Reputation: 2
You could try:

Code:
grep -r vnstat /etc/cron*
It's probably in /etc/cron.d somewhere.
 
Old 06-09-2010, 12:27 PM   #3
forrestt
Senior Member
 
Registered: Mar 2004
Location: Cary, NC, USA
Distribution: Fedora, Kubuntu, RedHat, CentOS, SuSe
Posts: 1,288

Rep: Reputation: 99
What does 'crontab -l' give you?

Forrest
 
Old 06-09-2010, 02:09 PM   #4
colucix
LQ Guru
 
Registered: Sep 2003
Location: Bologna
Distribution: CentOS 6.5 OpenSuSE 12.3
Posts: 10,509

Rep: Reputation: 1983Reputation: 1983Reputation: 1983Reputation: 1983Reputation: 1983Reputation: 1983Reputation: 1983Reputation: 1983Reputation: 1983Reputation: 1983Reputation: 1983
Well, you have already found the offending process name. You might check the documentation of vnstat and see how it works. For example in the INSTALL file provided along with the source code you see:
Code:
There are two way
 for updating interface data, daemon and cron. It is suggested to use daemon
 based updating because it generated less disk access and is more accurate
 especially when monitoring interfaces that aren't always available. Select
 ONLY ONE of these two:

 1) daemon based updating
 ::::::::::::::::::::::::

   Configure init scripts so that the following command is executed once
   during system start:

       vnstatd -d

   The examples/init.d directory contains suitable init.d scripts for
   some commonly used distributions. An alternative option is to just add
   the command to an already existing script that gets executed during
   startup. In many distributions /etc/rc.local can be used for that.

 2) cron based updating
 ::::::::::::::::::::::

   Copy the example cron file to /etc/cron.d

       cp examples/vnstat.cron /etc/cron.d/vnstat

   and edit the cron file if the default 5 minute update interval is too
   long. See the vnStat man page 'restrictions' section for limitations
   regarding fast interfaces and 32 bit interface traffic counters. Devices
   like ppp0 also require vnStat enable and disable commands to be added
   to suitable script file when cron based updating is used. Example scripts
   can be found in the 'examples' directory.
Case two seems to be the issue here, anyway from the output of ps it looks like the software has not been properly installed, since the command:
Code:
/bin/bash /usr/sbin/vnstat.cron
does not make any sense. If you're not aware of who and why installed this software or if you simply don't need it anymore, you might totally remove it (provided you can find out the installation method). In that case, first check if by chance the vnstat daemon is running and switch it off. Hope this helps.
 
Old 06-10-2010, 01:40 PM   #5
DennisC31
Member
 
Registered: May 2007
Location: beyond my means
Distribution: Mint 11.04
Posts: 55

Original Poster
Rep: Reputation: 19
We have a winner!

Thank you ALL for your assistance. This is why I love this OS.

The mystery job was in /etc/cron.d. =)

And for what its worth, I installed the application but I was lazy and did not want to fight with the source code not behaving nicely. So I found and downloded an RPM created by Bumphrey the linux guy who has spare time. Then I installed that RPM and this is what it did. Lots of stuff for the prog went into weird places as some of you have noted.

Many, many thanks to all of you for this help. This was driving me nuts.

Last edited by DennisC31; 04-11-2012 at 05:27 PM.
 
  


Reply



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 Off
HTML code is Off



Similar Threads
Thread Thread Starter Forum Replies Last Post
linux cron job duplicate job question cpthk Linux - Newbie 4 09-11-2009 08:52 PM
Cron Job Help grande25 Programming 35 11-02-2008 12:42 AM
adding a perl script to cron.daily / cron.d to setup a cron job CrontabNewBIE Linux - Software 6 01-14-2008 08:16 AM
Cron Mystery / Perl webwiznz Linux - General 2 05-23-2004 06:11 PM
Cron job rajasekarvr Linux - General 4 05-03-2004 05:35 PM

LinuxQuestions.org > Forums > Linux Forums > Linux - Server

All times are GMT -5. The time now is 10:59 PM.

Main Menu
Advertisement
My LQ
Write for LQ
LinuxQuestions.org is looking for people interested in writing Editorials, Articles, Reviews, and more. If you'd like to contribute content, let us know.
Main Menu
Syndicate
RSS1  Latest Threads
RSS1  LQ News
Twitter: @linuxquestions
Open Source Consulting | Domain Registration