Not a directory: /etc/cron.hourly

bidouilleur

Well-Known Member
Apr 27, 2003
47
0
156
cPanel Access Level
Root Administrator
since a few days I have 2 servers sending me each hour a root mail from cron daemon with the line you see in title...

they both are running

WHM 10.8.0 cPanel 10.8.2-R80
CentOS 4.3 i686 - WHM X v3.1.0

I had a look in terminal there is a directory, owned by root and I couldn't see anything wrong with permissions

I looked in this forum and a little wider on the net but I couldn't find any topic with this issue

I don't consider myself as an expert but still... Can't make head nor tail of this

Anything I can do to solve or give you more elements to help me solve this issue ?

One is an AMD and the other a P4, only commen is Centos basically and cpanel

thanks for your help

eric
 

avijit

Well-Known Member
Jul 26, 2004
116
0
166
India
Whats in the body and the header of the message ?
 

bidouilleur

Well-Known Member
Apr 27, 2003
47
0
156
cPanel Access Level
Root Administrator
here is the complete mail with all details, just took out some names and mails to avoid spammer to increase the wrok of my anti spamfilter ;)

Return-path: <[email protected]*****.com>
Envelope-to: ***********
Delivery-date: Tue, 09 May 2006 09:01:03 +0100
Received: from ******** by ********.com with local-bsmtp (Exim 4.52)
id 1FdN9R-0003yX-U3
for**********; Tue, 09 May 2006 09:01:02 +0100
X-Spam-Checker-Version: SpamAssassin 3.1.1 (2006-03-10) on ********.com
X-Spam-Level:
X-Spam-Status: No, score=-2.6 required=5.0 tests=BAYES_00,NO_RELAYS
autolearn=ham version=3.1.1
Received: from root by*******.com with local (Exim 4.52)
id 1FdN9R-0003yT-EL
for [email protected]*********.com; Tue, 09 May 2006 09:01:01 +0100
From: [email protected]********.com (Cron Daemon)
To: [email protected]*********.com
Subject: Cron <[email protected]***> run-parts /etc/cron.hourly
X-Cron-Env: <SHELL=/bin/bash>
X-Cron-Env: <PATH=/sbin:/bin:/usr/sbin:/usr/bin>
X-Cron-Env: <MAILTO=root>
X-Cron-Env: <HOME=/>
X-Cron-Env: <LOGNAME=root>
X-Cron-Env: <USER=root>
Message-Id: <[email protected]*******.com>
Date: Tue, 09 May 2006 09:01:01 +0100
Sender: <***@****.com>
Status: R
X-Status: NC
X-KMail-EncryptionState:
X-KMail-SignatureState:
X-KMail-MDN-Sent:

Not a directory: /etc/cron.hourly
thanks for your help and time

eric
 

avijit

Well-Known Member
Jul 26, 2004
116
0
166
India
It seems the some of the cron files palced in that directory has errors Make sure that files under that directory has the permissions 755 and ownership of roots.
 

bidouilleur

Well-Known Member
Apr 27, 2003
47
0
156
cPanel Access Level
Root Administrator
a little late but short of time.. in the meantime the problem still occurs

I have checked the file permission, it is 755, it is owned by root..

the only cron in there is modsecparse.pl and when I run it manually, I get no errors...

Nothing on cron log indicating prolems

any idea what is causing this problem ?? Is there something I can do to uncover the error if any ????
 

bidouilleur

Well-Known Member
Apr 27, 2003
47
0
156
cPanel Access Level
Root Administrator
Sorry to bump this topic but I'm stuck and nothing I try helps

no one ever had this or has an idea what could create this behaviour ?

thanks for your ideas
 

bmcgrail

Well-Known Member
Dec 8, 2003
83
0
156
the command in your email is

Code:
run-parts /etc/cron.hourly
Try entering that on the command line and see what happens.

If that works track down where cron is running it from, delete the line and re-type it. Maybe a hidden character is messing it up? Sounds unlikely, but I've seen it happen.

If that doesn't work, try moving cron.hourly to cron.hourly.bak and making a new cron.hourly directory.

Good luck, hope this helps.
 

bidouilleur

Well-Known Member
Apr 27, 2003
47
0
156
cPanel Access Level
Root Administrator
I made a new directory cron.hourly and moved the cron in there.
That didn't solve the problem

I traced run-parts to /usr/bin/

Now I have no clue what is triggering that script. opening the script confirms that it is indeed via this that the error mail comes :

if [ ! -d $1 ]; then
echo "Not a directory: $1"
exit 1
fi


that's the part sending the error

But now, how do you trace how and who triggered it ?

i opened crontab .....but according me there is nothing triggering this...

7 0 * * * /scripts/upcp
0 1 * * * /scripts/cpbackup
*/15 * * * * /usr/local/cpanel/whostmgr/bin/dnsqueue > /dev/null 2>&1
2,58 * * * * /usr/local/bandmin/bandmin
0 0 * * * /usr/local/bandmin/ipaddrmap
10 13 * * * cd /usr/local/cpanel/whostmgr/docroot/cgi/fantastico/scripts/ ; /usr/local$
11 4 * * * /usr/local/cpanel/whostmgr/docroot/cgi/cpaddons_report.pl --notify
0 6 * * * /scripts/exim_tidydb > /dev/null 2>&1
*/5 * * * * /usr/local/cpanel/bin/dcpumon >/dev/null 2>&1


am at a loss.... any idea what triggers this run-parts ?
 

xprt5

Well-Known Member
Apr 6, 2003
72
0
156
Houston
run-parts cron.hourly is run by cron from the /etc/crontab file

There is a run-parts entry for hourly, daily, weekly and monthly.
 

bidouilleur

Well-Known Member
Apr 27, 2003
47
0
156
cPanel Access Level
Root Administrator
Problem solved as follows, might be interesting for someone having same issue

It is indeed in /etc/crontab that the problem occured, though we couldn't find out why

Kevin (Thanks man) from support fiddled around and basically deleted the lines in that file and retyped it.... and gone is the problem... as said something in the line was bad but what ?? I looked afterwards closely on the other server and compaired the lines from the now working crontab and the 'corrupt' one and couldn't find anything different, even counted spaces etc.....

Anyway, I copied the content, rm crontab, touch crontab and pasted the content back in and .... no errors anymore...

Well a few others pop up now since that is running back normal but... that's maybe for another topic ;)

In any case, once again a thanks to Kevin for his help.