LinuxQuestions.org

LinuxQuestions.org (/questions/)
-   Linux - Newbie (https://www.linuxquestions.org/questions/linux-newbie-8/)
-   -   Cron Log File Error Message (https://www.linuxquestions.org/questions/linux-newbie-8/cron-log-file-error-message-746474/)

lapidarynewbie 08-10-2009 10:50 AM

Cron Log File Error Message
 
One of our CentOS 5.3 installations is showing the following (sanitized) error in its cron log:

crond [nnnnnn]: (*system*) BAD FILE MODE (/etc/crontab)

Most/all of the postings I've seen based on a Google search pins that down to a permissions problem on a crontab job and suggests doing a chmod 644; however, the error message usually includes the specific job giving the problem. In our case it doesn't. How should we interpret this error and what do we need to do to fix it.

Many thanks for your help!

Tinkster 08-10-2009 11:39 AM

What are the perms on the file? Which job does the time-stamp in
the log match?



Cheers,
Tink

lapidarynewbie 08-10-2009 11:48 AM

That's just it! All the error says is "/etc/crontab" It doesn't give a particular job and the user is *system*. (No individual user accounts have cron jobs.) If I knew what job was running that caused the problem, I go check the permissions on that job and change them appropriately.

Tinkster 08-10-2009 12:22 PM

No ... it's complaining about the perms on the crontab file,
not on any entry cron points at.

ls -l /etc/crontab


And as for the job; look at the time-stamp, compare against
all the possible cron jobs on the system. If there are no
individual ones per user, it HAS to be a job in /etc/crontab,
/etc/cron.d (.hourly) (.daily) (.weekly).



Cheers,
Tink

lapidarynewbie 08-10-2009 12:26 PM

Ah ha! Blind I am (to mimic that sage philospher Yoda). Okay, yes, the permissions are basically wide open. What permissions do you suggest? Will chmod 644 -rw-r--r-- work?

unSpawn 08-10-2009 01:04 PM

'man 5 crontab' yields "In this version of cron , /etc/crontab must not be writable by any user other than root.", 'rpm -qf /etc/crontab --qf='%{name}\n' yields "crontabs", 'rpm -q crontabs --dump | awk '/\/etc\/crontab/ {print $5}'' yields 0100644 (so 'rpm --setperms crontabs' should do the same)... is your answer.

lapidarynewbie 08-13-2009 12:35 PM

Forgot how, but we got this worked out. Part of the problem was how the cron jobs were moved over from the old RHEL 5.x installation. Permission. We got it worked out.


All times are GMT -5. The time now is 05:03 PM.