Linux - NewbieThis Linux forum is for members that are new to Linux.
Just starting out and have a question?
If it is not in the man pages or the how-to's this is the place!
Notices
Welcome to LinuxQuestions.org, a friendly and active Linux Community.
You are currently viewing LQ as a guest. By joining our community you will have the ability to post topics, receive our newsletter, use the advanced search, subscribe to threads and access many other special features. Registration is quick, simple and absolutely free. Join our community today!
Note that registered members see fewer ads, and ContentLink is completely disabled once you log in.
If you have any problems with the registration process or your account login, please contact us. If you need to reset your password, click here.
Having a problem logging in? Please visit this page to clear all LQ-related cookies.
Get a virtual cloud desktop with the Linux distro that you want in less than five minutes with Shells! With over 10 pre-installed distros to choose from, the worry-free installation life is here! Whether you are a digital nomad or just looking for flexibility, Shells can put your Linux machine on the device that you want to use.
Exclusive for LQ members, get up to 45% off per month. Click here for more info.
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.
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.
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).
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?
'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.
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.
LinuxQuestions.org is looking for people interested in writing
Editorials, Articles, Reviews, and more. If you'd like to contribute
content, let us know.