LinuxQuestions.org
Review your favorite Linux distribution.
Home Forums Tutorials Articles Register
Go Back   LinuxQuestions.org > Forums > Enterprise Linux Forums > Linux - Enterprise
User Name
Password
Linux - Enterprise This forum is for all items relating to using Linux in the Enterprise.

Notices


Reply
  Search this Thread
Old 11-04-2006, 12:08 AM   #1
henrybg
LQ Newbie
 
Registered: Oct 2006
Posts: 4

Rep: Reputation: 0
Red face Cron jobs not running


Hi Guys,

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?

Henry
 
Old 11-04-2006, 01:14 AM   #2
rylan76
Senior Member
 
Registered: Apr 2004
Location: Potchefstroom, South Africa
Distribution: Fedora 17 - 3.3.4-5.fc17.x86_64
Posts: 1,552

Rep: Reputation: 103Reputation: 103
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

/val/log/cron.log

?

See if there is anything informative contained in there.
 
Old 11-04-2006, 05:16 AM   #3
sundaralingam
LQ Newbie
 
Registered: Jun 2006
Posts: 1

Rep: Reputation: 0
Hi,

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

Last edited by sundaralingam; 11-04-2006 at 05:19 AM.
 
Old 11-04-2006, 05:39 AM   #4
henrybg
LQ Newbie
 
Registered: Oct 2006
Posts: 4

Original Poster
Rep: Reputation: 0
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[311]: (root) LIST (root)
Nov 4 01:46:31 onlinelv crontab[382]: (root) BEGIN EDIT (root)
Nov 4 01:47:04 onlinelv crontab[382]: (root) REPLACE (root)
Nov 4 01:47:04 onlinelv crontab[382]: (root) END EDIT (root)
Nov 4 01:48:01 onlinelv crond[18317]: (root) RELOAD (cron/root)
Nov 4 06:26:56 onlinelv crontab[9671]: (root) LIST (root)
 
Old 11-04-2006, 05:45 AM   #5
henrybg
LQ Newbie
 
Registered: Oct 2006
Posts: 4

Original Poster
Rep: Reputation: 0
Ohh! by the way, I am at runlevel 5.
 
Old 11-04-2006, 01:42 PM   #6
Quigi
Member
 
Registered: Mar 2003
Location: Cambridge, MA, USA
Distribution: Ubuntu (Dapper and Heron)
Posts: 377

Rep: Reputation: 31
Quote:
Originally Posted by henrybg
Cron daemon is running. Here are the response to the suggestions thus far. Thanks in advance.
Did you check for the process crond, as sundaralingam and rylan76 suggested? Does ps -fC crond turn anything up? Then again, you have the one RELOAD entry from crond in the log, so it did something (maybe dying right after?).

Quote:
[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
OK, it seems configured so that is should run.
Quote:
[root@onlinelv online]# tail /var/log/cron
Nov 4 01:34:40 onlinelv crontab[311]: (root) LIST (root)
Nov 4 01:46:31 onlinelv crontab[382]: (root) BEGIN EDIT (root)
Nov 4 01:47:04 onlinelv crontab[382]: (root) REPLACE (root)
Nov 4 01:47:04 onlinelv crontab[382]: (root) END EDIT (root)
Nov 4 01:48:01 onlinelv crond[18317]: (root) RELOAD (cron/root)
Nov 4 06:26:56 onlinelv crontab[9671]: (root) LIST (root)
I don't see any entries showing CoMmanDs being run (matching your diagnosis). On mine, I see:
Code:
Oct 30 02:01:00 lithium CROND[8246]: (root) CMD (run-parts /etc/cron.hourly)
Oct 30 03:01:00 lithium CROND[8568]: (root) CMD (run-parts /etc/cron.hourly)
Oct 30 03:33:00 lithium CROND[8735]: (monce) CMD (/home/monce/script/consolidate 5 \%Y-\%m-\%d '??-??-??')
Oct 30 04:01:00 lithium CROND[8956]: (root) CMD (run-parts /etc/cron.hourly)
You see jobs for different users being run. The monce job is mine; root's run-parts apparently comes with Fedora Core.

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.
 
Old 11-05-2006, 02:59 AM   #7
henrybg
LQ Newbie
 
Registered: Oct 2006
Posts: 4

Original Poster
Rep: Reputation: 0
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?

NOTE:

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.
 
Old 03-21-2011, 10:54 AM   #8
alienslideshow
LQ Newbie
 
Registered: May 2008
Posts: 4

Rep: Reputation: 0
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?
 
Old 04-04-2011, 05:04 PM   #9
Nominal Animal
Senior Member
 
Registered: Dec 2010
Location: Finland
Distribution: Xubuntu, CentOS, LFS
Posts: 1,723
Blog Entries: 3

Rep: Reputation: 948Reputation: 948Reputation: 948Reputation: 948Reputation: 948Reputation: 948Reputation: 948Reputation: 948
Quote:
Originally Posted by alienslideshow View Post
I've had problems using the /tmp directory for cron jobs in linux.
Do you have noexec in the line containing /tmp in /etc/mtab ? If you do, you have specifically prohibited running programs and scripts from /tmp. I do it on CentOS, but not on Ubuntu. (On Ubuntu and possibly other Debian variants update scripts are run in /tmp or /var/tmp. Allowing exec on one but not the other makes very little sense, since they're both world-writable.)
 
Old 10-11-2012, 03:44 PM   #10
mcoliver
LQ Newbie
 
Registered: Oct 2012
Posts: 1

Rep: Reputation: Disabled
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:
/etc/init.d/crond restart
 
Old 01-28-2013, 10:23 AM   #11
crashfive
LQ Newbie
 
Registered: Jan 2013
Posts: 1

Rep: Reputation: Disabled
Did any of the above recommendation/possible solutions fix your problem? If so, can you state which? I'm having the same issue.
 
  


Reply

Tags
cron, redhat, security



Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is Off
HTML code is Off



Similar Threads
Thread Thread Starter Forum Replies Last Post
cron is running but jobs aren't kalahari875 Mandriva 4 03-15-2006 03:47 PM
One user's cron jobs not running dcroxton Linux - Software 5 03-06-2006 03:33 PM
shutdown only if no cron jobs are running Red Squirrel Linux - Software 4 08-31-2005 01:00 PM
SUID problem running cron jobs? mitchloft Fedora 4 03-24-2005 12:30 PM
cron jobs not running scarr3d Linux - Software 7 05-25-2004 04:21 PM

LinuxQuestions.org > Forums > Enterprise Linux Forums > Linux - Enterprise

All times are GMT -5. The time now is 03:33 AM.

Main Menu
Advertisement
My LQ
Write for LQ
LinuxQuestions.org is looking for people interested in writing Editorials, Articles, Reviews, and more. If you'd like to contribute content, let us know.
Main Menu
Syndicate
RSS1  Latest Threads
RSS1  LQ News
Twitter: @linuxquestions
Open Source Consulting | Domain Registration