Run-parts is using a lot of resources

R-J

Verified User
Joined
Dec 31, 2003
Messages
8
Location
Haarlem, Holland
Yesterday the process 'run-parts' started to use a lot of system resources. Every hour it starts a new proces, which behaves the same way. Taking up twice as much resources.
If I don't kill the processes, within 12 hours the server goes down under heavy load.

From the PS command I understand it has something to do with Cron.
Code:
ps -auxf

root      3974  0.0  0.0  1648  688 ?        S    Feb20   0:00 crond
root      9318  0.0  0.0  1648  684 ?        S    13:01   0:00  \_ CROND
root      9319 97.7  0.0  2136  960 ?        R    13:01   3:11      \_ /bin/bash /usr/bin/run-parts /etc/cron.hourly

I'm not that familiar with linux, does someone have any suggestions on how to find out what's actually happening on my server or what's going wrong?
 
Have been watching all the active processes using 'top'. i.e. at 20:01:01, every hours first minute that Cron is calling 'cron.hourly' the process gets started.

The weird thing is, the directory /etc/cron.daily is empty ?

Should there be any files in this directory by default?
 
Yes.
Code:
[jeff@da1 cron.daily]$ ls -al
total 40
drwxr-xr-x    2 root     root         4096 May 20  2004 .
drwxr-xr-x   44 root     root         4096 Feb 21 00:22 ..
lrwxrwxrwx    1 root     root           28 Aug 20  2003 00-logwatch -> ../log.d/scripts/logwatch.pl
-rwx------    1 root     root          276 Jun 24  2001 0anacron
-rwx------    1 root     root           55 May 20  2004 chkrootkit
-rwx------    1 root     root           51 Apr 15  2002 logrotate
-rwx------    1 root     root          418 Apr 29  2003 makewhatis.cron
-rwx------    1 root     root         2142 Nov 18  2003 raidwatch
-rwx------    1 root     root          104 Apr 18  2002 rpm
-rwx------    1 root     root          132 Jun 24  2001 slocate.cron
-rwx------    1 root     root          193 Apr 13  2002 tmpwatch
[jeff@da1 cron.daily]$
Of the above, all except chkrootkit were installed by my OS installation; chkrootkit was installed by me.

Jeff
 
Whoops, I meant cron.hourly is empty.
My cron.daily directory contains the same files.

Should there be any files by default in cron.hourly?
 
I've commented the following line in my crontab file
Code:
#01 * * * * root run-parts /etc/cron.hourly
Which is a temporary workaround, the problem still remains.

How do I find out what task Cron of run-parts is currently running?
Or is there some kind of error log, where errors from scripts run by cron get logged?

Please help, although I'm learning fast I'm still a linux newbie ;)
 
By default /etc/cron.hourly is empty.

We put a clockset script there to keep our servers' time synchronized.

Cron's log file is:

/var/log/cron

:)

Jeff
 
Seems like the problem is the run-parts application. Last three days 'cron.daily' went madd too and I expect cron.weekly will do the same this weekend.
There don't seem to be any errors in any logfile at all, related to cron.daily, only some references to that cron launched 'cron.daily' in the cron log.

I already compared the run-parts script with copies on other servers, but there's no difference.

1). Does 'run-parts' have any software requirements to be able to run without any troubles?

2). How do I verify if all tasks in 'cron.daily' have completed their jobs last night?

3). Would it work if put entries for al daily cron jobs straight into the crontab and as a workaround disable the reference to 'cron.daily' or can I expect some problems?

Lots of questions but I hope someone knows or has any suggestions on how to solve it.
 
R-J said:
3). Would it work if put entries for al daily cron jobs straight into the crontab and as a workaround disable the reference to 'cron.daily' or can I expect some problems?
This seemed to work and without any hassles or heavy server load.

Still I'm wondering why run-parts started freaking out of nothing?

On monday all I've done was upgrading phpMyAdmin to 2.7.0pl2 using this ( http://directadmin.com/forum/showthread.php?s=&threadid=10897 ) shell script.
There were no errors and phpMyAdmin is running fine without any troubles. The only connection I can think of is that 'the upgrade script' and 'run-parts' are both shell scripts.

The update script has a reference to
Code:
#!/bin/sh
and run-parts has a reference to
Code:
#!/bin/bash

Is this a problem or doesn't it have anything to do with the problem of 'run-parts' taking up a lot of resources ((serverload up to 1500)?
 
Back
Top