LinuxQuestions.org
Review your favorite Linux distribution.
Home Forums Tutorials Articles Register
Go Back   LinuxQuestions.org > Forums > Linux Forums > Linux - General
User Name
Password
Linux - General This Linux forum is for general Linux questions and discussion.
If it is Linux Related and doesn't seem to fit in any other forum then this is the place.

Notices


Reply
  Search this Thread
Old 04-12-2008, 08:31 AM   #1
investmentbnker75
Member
 
Registered: Oct 2007
Location: Eastern Seaboard
Distribution: CentOS
Posts: 162

Rep: Reputation: 15
Stopping crond running a program


I have sar running on my server and it kills it sometimes with using too much memory. Ive deleted the cron job out of /etc/cron.d/sysstat and chmodded the /usr/lib64/sa dir 000. But i still get emails from crond saying it cant run the program. How do i get crond from wanting to look for sa or sar and trying to run it. Its not in any other crons, ive searched all crontab, cron.daily, cron.weekly, cron.monthly, etc...

There is nothing in /var/spool/cron. Here is an example of the emails i keep getting:

From: cron daemon
/bin/sh: /usr/lib64/sa/sa1: Permission denied


Thanks in advance
 
Old 04-12-2008, 08:56 AM   #2
aus9
LQ 5k Club
 
Registered: Oct 2003
Location: Western Australia
Distribution: Icewm
Posts: 5,842

Rep: Reputation: Disabled
try
Code:
grep -iR 'sa' /etc
 
Old 04-12-2008, 08:59 AM   #3
Bruce Hill
HCL Maintainer
 
Registered: Jun 2003
Location: McCalla, AL, USA
Distribution: Arch, Gentoo
Posts: 6,940

Rep: Reputation: 129Reputation: 129
Yes, and flood your term when you "try" that ^^^

Read "man sa1" and if you can't fix it, then post back.

Last edited by Bruce Hill; 04-12-2008 at 09:02 AM.
 
Old 04-12-2008, 06:30 PM   #4
investmentbnker75
Member
 
Registered: Oct 2007
Location: Eastern Seaboard
Distribution: CentOS
Posts: 162

Original Poster
Rep: Reputation: 15
Thanks guys but neither one of those helped, the grep -iR 'sa' /etc scrolled 10 million things and nothing really pointed me in the right direction and the man page for sa1, sar and anything related i've already read.

There is nothing sa related in cron, that i can see. If you have any other suggestions please let me know.


Thanks,
 
Old 04-12-2008, 06:56 PM   #5
aus9
LQ 5k Club
 
Registered: Oct 2003
Location: Western Australia
Distribution: Icewm
Posts: 5,842

Rep: Reputation: Disabled
my apols

I have tested a new search that produces one line for me....yes I should have tested my last....try with root powers

grep -wr '\<'sa'\>'--fixed-strings /etc ....then if you notice only a few lines or none you can try sa1 etc
 
Old 04-12-2008, 07:37 PM   #6
investmentbnker75
Member
 
Registered: Oct 2007
Location: Eastern Seaboard
Distribution: CentOS
Posts: 162

Original Poster
Rep: Reputation: 15
No prob aus9, thanks for reposnding so quickly. Running that didnt point me in the right direction. Thanks for trying though. I may give up and just dev/null the emails. But it sure would be nice to know for furture reference what is causing them.
 
Old 04-13-2008, 07:27 AM   #7
aus9
LQ 5k Club
 
Registered: Oct 2003
Location: Western Australia
Distribution: Icewm
Posts: 5,842

Rep: Reputation: Disabled
me too after my last puny effort.

http://freshmeat.net/projects/sysstat/

shows some more search terms... sadf...iostat ....pidstat....mpstat

2) I am sure you have already looked at all of your /etc/cron....and /etc/crontab so maybe you have a rc.local or other script that is calling cron?

eg
find / -name crond

/etc/netprofile/profiles/default/services/crond
/etc/rc.d/init.d/crond
/etc/pam.d/crond
/var/lock/subsys/crond
/usr/sbin/crond

find / -name cron

/etc/logrotate.d/cron
/var/log/cron
/var/spool/cron

what I am trying to suggest...trying to recover some dignity...is you have mail from cron so its the cron daemon but which?
 
Old 04-13-2008, 11:06 AM   #8
investmentbnker75
Member
 
Registered: Oct 2007
Location: Eastern Seaboard
Distribution: CentOS
Posts: 162

Original Poster
Rep: Reputation: 15
Thanks again aus9. Those didint help but looking again in the /var/log/cron file i see where it tries to run as part of /etc/cron.hourly but looking there i dont see any cron jobs at all. Maybe this info can help find a solution?

/var/log/cron:

Apr 13 12:01:01 servername crond[26070]: (root) CMD (run-parts /etc/cron.hourly)


whats in cron.hourly:

ls -la
total 24
drwxr-xr-x 2 root root 4096 Sep 20 2004 .
drwxr-xr-x 90 root root 12288 Apr 12 09:47 ..
 
Old 04-13-2008, 08:01 PM   #9
aus9
LQ 5k Club
 
Registered: Oct 2003
Location: Western Australia
Distribution: Icewm
Posts: 5,842

Rep: Reputation: Disabled
I do not run a server....can you stop crond and restart it? I am aware you do not like taking down the server....but on its next scheduled downtime...a full reboot might fix the issue if the restart fails?

Mdv has a gui to stop it /usr/sbin/crond so here is how to do it with rh if you did not know
http://www.cyberciti.biz/faq/howto-l...-restart-cron/
 
Old 04-13-2008, 09:00 PM   #10
gilead
Senior Member
 
Registered: Dec 2005
Location: Brisbane, Australia
Distribution: Slackware64 14.0
Posts: 4,141

Rep: Reputation: 168Reputation: 168
What is the time stamp on the emails you're getting? That may provide another clue. Also, although you've checked /var/log/cron it may be worth running crontab -l (that's a lower case "L") as root to see if there is anything being run outside of /etc/cron.*. For example I have a box here with the following in root's crontab:
Code:
*/10 * * * * /usr/lib/sa/sa1 1 1
53 23 * * * /usr/lib/sa/sa2 -A | mail -s "SysStat daily summary completed" root
 
Old 04-13-2008, 11:04 PM   #11
investmentbnker75
Member
 
Registered: Oct 2007
Location: Eastern Seaboard
Distribution: CentOS
Posts: 162

Original Poster
Rep: Reputation: 15
Hi Steve,

If you re-read my very first post, ive already deleted that cron job and said there is nothing in /var/log/cron. Thanks for trying though. Actually i found the solution. In ps accounting there is a script that calls sar to run. If you chmod that 000 it will stop crond from trying to run the program.


Aus9, thanks for your help. Restarting crond isnt really a big deal on a server, ive done it several times.
 
  


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



Similar Threads
Thread Thread Starter Forum Replies Last Post
crond not running praveenv Linux - Newbie 6 08-31-2004 08:03 AM
C++: running system() without stopping program kamel Programming 3 05-31-2004 04:42 PM
problem running crond wakeupatul Linux - General 1 04-20-2004 01:28 PM
ps -aux output: CROND running repeatedly redhatman Linux - Newbie 1 03-29-2004 08:51 PM
Crond running to many processes <defunct> tpfraz Linux - General 1 01-13-2004 07:03 AM

LinuxQuestions.org > Forums > Linux Forums > Linux - General

All times are GMT -5. The time now is 03:19 AM.

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