Cron jobs not running
I have RedHat AS installed and running fine. On Oct. 3 I changed the time via the Desktop. Ever since that day, none of my cron jobs have run. Even after I have performed a reboot. I also tried a simple task where I touch a file in the tmp directory. That file has never been created. What could have caused my crond to stop processing stuff in the crontab?
Have you taken a look if
1. Cron is running at all
2. That there is not some clue in its log file?
To test if cron is running, go to a terminal and do
ps -A | grep cron
I think its log file should be in
See if there is anything informative contained in there.
check if "ps -ef|grep cron" does not show cron is running.
1. chkconfig --list|grep cron
2. check for log file /var/log/cron
Cron daemon is running. Here are the response to the suggestions thus far. Thanks in advance.
[root@onlinelv online]# ls -l /val/log/cron.log
ls: /val/log/cron.log: No such file or directory
[root@onlinelv online]# chkconfig --list|grep cron
anacron 0 off 1 off 2 on 3 on 4 on 5 on 6 off
crond 0 off 1 off 2 on 3 on 4 on 5 on 6 off
[root@onlinelv online]# ls -l /var/log/cron
-rw------- 1 root root 7110 Nov 4 06:26 /var/log/cron
[root@onlinelv online]# tail /var/log/cron
Nov 4 01:34:40 onlinelv crontab: (root) LIST (root)
Nov 4 01:46:31 onlinelv crontab: (root) BEGIN EDIT (root)
Nov 4 01:47:04 onlinelv crontab: (root) REPLACE (root)
Nov 4 01:47:04 onlinelv crontab: (root) END EDIT (root)
Nov 4 01:48:01 onlinelv crond: (root) RELOAD (cron/root)
Nov 4 06:26:56 onlinelv crontab: (root) LIST (root)
Ohh! by the way, I am at runlevel 5.
Regarding your machine, I'm poking in the dark. Would you care sharing `crontab -l` for some user on your machine? Look in /var/log/messages? Run df to see if some file system filled up -- that can sometimes cause the most obscure errors?
BTW, if a cron job runs (which it didn't) and writes anything to stdout or stderr, cron will send it to the owner by e-mail.
the messages file indicated that the cron failed because it could not get the tty.
From that info in the messages file I found my way to this helpful hint on the web regarding the use of pam.d I just realized that disabling direct sign-on for system accounts affected the cron job. However, I have all the recommendations in place as outlined below. Should I restart any daemon to make the active without a reboot?
In RHEL4 pam_access is already configured for crond:
# grep pam_access /etc/pam.d/*
/etc/pam.d/crond:account required pam_access.so accessfile=/etc/security/access-cron.conf
This means that the above entries in /etc/security/access.conf will stop cron from working. Note that it is very prudent to always check whether pam_access is configured for any other service on the system!
To ensure that all users on the system can still run cron jobs you can add the following argument to pam_access in /etc/pam.d/crond:
account required pam_access.so accessfile=/etc/security/access-cron.conf
This ensures that the /etc/security/access.conf configuration file is not invoked by crond. Since pam_cracklib does not grant permissions if the configuration file does not exist, execute the following command to create an empty file:
# touch /etc/security/access-cron.conf
Now verify that cron jobs can be launched by any user on the system.
I've had problems using the /tmp directory for cron jobs in linux. Note that I do the same thing in HPUX, Solaris and AIX and have no problem. But for some reason in Linux I can't use the /tmp directory with my cron jobs and end up putting them in /root. Then they work as expected.
Can anyone explain this?
Run the command:
ps aux | grep -i cron | grep -v grep
It should give you output like below:
root 20584 0.3 0.0 117240 1444 ? Ss 13:40 0:00 crond
If the crond process is not there try restarting it:
Did any of the above recommendation/possible solutions fix your problem? If so, can you state which? I'm having the same issue.
|All times are GMT -5. The time now is 06:53 PM.|