Unix Technical Forum

multiple cron daemons running

This is a discussion on multiple cron daemons running within the Slackware Linux Support forums, part of the Unix Operating Systems category; --> My cron daemon is acting odd. Certain entries don't run correctly and I'm getting some strange error messages. It ...


Go Back   Unix Technical Forum > Unix Operating Systems > Slackware Linux Support

FAQ Members List Calendar Search Today's Posts Mark Forums Read
  #1 (permalink)  
Old 02-18-2008, 09:49 AM
Mark Grimes
 
Posts: n/a
Default multiple cron daemons running

My cron daemon is acting odd. Certain entries don't run correctly and
I'm getting some strange error messages. It looks like two cron daemons
may be running but I can't find more than one entry in my rc.d scripts.

A "ps ax | grep crond" returns two crond processes. Anyone know if this
is normal? Does cron fork off another process?

Here are some of the error messages I am receiving:

7 Jul 04:40:02 ntpdate[3060]: the NTP socket is in use, exiting
fatal error: updatedb: create_db(): rename: No such file or directory

Both run fine by hand and the locate database is being updated.

I have also found a number of these entries in /var/log/cron:

Jul 6 15:20:30 chef atd[937]: Another atd already running with pid 522

But again, I can only find one entry for atd in my rc.d scripts. I've
tried to grep for both of them:

grep -r crond /etc/*
grep -r /usr/sbin/atd /etc/*

But the only entries are the following:

/etc/rc.d/rc.M:if [ -x /usr/sbin/atd ]; then
/etc/rc.d/rc.M: /usr/sbin/atd -b 15 -l 1

/etc/rc.d/rc.M:# Start crond (Dillon's crond):
/etc/rc.d/rc.M:if [ -x /usr/sbin/crond ]; then
/etc/rc.d/rc.M: /usr/sbin/crond -l10 >>/var/log/cron 2>&1

I have recently upgrade to slak 9, and didn't have any problems before.
Thanks for any help!
Digg this Post!Add Post to del.icio.usBookmark Post in TechnoratiFurl this Post!
Reply With Quote
  #2 (permalink)  
Old 02-18-2008, 09:49 AM
/dev/rob0
 
Posts: n/a
Default Re: multiple cron daemons running

In article <MPG.19733e3b4bc18b33989685@news.sf.sbcglobal.net> ,
Mark Grimes wrote:
> Here are some of the error messages I am receiving:
>
> 7 Jul 04:40:02 ntpdate[3060]: the NTP socket is in use, exiting


If you try to run ntpdate whilst ntpd is running, you will get this
error. If you're using a cron'ed ntpdate job to update your system time
you should consider just using ntpd in its place. It's not difficult to
configure ntpd.

One lesson I learned the hard way: if your hardware clock is likely to
be far off at boot time (such as a dead CMOS battery) it helps to have a
ntpdate command in rc.local BEFORE you start ntpd.

> fatal error: updatedb: create_db(): rename: No such file or directory
>
> Both run fine by hand and the locate database is being updated.


Perhaps you could look in the updatedb source for this error. (Or
Google of course ...)

> I have also found a number of these entries in /var/log/cron:
>
> Jul 6 15:20:30 chef atd[937]: Another atd already running with pid 522
>
> But again, I can only find one entry for atd in my rc.d scripts. I've


What's in your crontab?

> I have recently upgrade to slak 9, and didn't have any problems before.


Ah, upgraded. Now it makes sense. 9.0 has a new root crontab and new
updatedb (now run by root, not nobody). Here's what your crontab should
look like:
# Run hourly cron jobs at 47 minutes after the hour:
47 * * * * /usr/bin/run-parts /etc/cron.hourly 1> /dev/null
#
# Run daily cron jobs at 4:40 every day:
40 4 * * * /usr/bin/run-parts /etc/cron.daily 1> /dev/null
#
# Run weekly cron jobs at 4:30 on the first day of the week:
30 4 * * 0 /usr/bin/run-parts /etc/cron.weekly 1> /dev/null
#
# Run monthly cron jobs at 4:20 on the first day of the month:
20 4 1 * * /usr/bin/run-parts /etc/cron.monthly 1> /dev/null
All the jobs are cound in the /etc/cron.* directories. I think there are
2 in daily and 1 in hourly.
--
/dev/rob0 - preferred_email=i$((28*28+28))@softhome.net
or put "not-spam" or "/dev/rob0" in Subject header to reply
Digg this Post!Add Post to del.icio.usBookmark Post in TechnoratiFurl this Post!
Reply With Quote
  #3 (permalink)  
Old 02-18-2008, 09:49 AM
Mark Grimes
 
Posts: n/a
Default Re: multiple cron daemons running

In article <MPG.19733e3b4bc18b33989685@news.sf.sbcglobal.net> ,
mark_usenet@peculiarities.com says...
> My cron daemon is acting odd. Certain entries don't run correctly and
> I'm getting some strange error messages. It looks like two cron daemons
> may be running but I can't find more than one entry in my rc.d scripts.


Well I found the problem. I added a few 'echo "Running..." >>/tmp/file'
entries to my rc.M and rebooted. In looking at the file, I found that
after running rc.local, rc.M started over again.

Running rc.M
Running crond
Ran crond
...
Running local
Running rc.M
Running crond
Ran crond
...
Running local
Ran local
Finishing rc.M
Ran local
Finishing rc.M

Turns out one of the files I was running in local, checked for an
arguement (start,stop,etc.) and if there was none, then ran:

$0 start

Works very nicely except: $0 == rc.M because the script had been
included with the . rather than executed.

Thanks for the help.
Digg this Post!Add Post to del.icio.usBookmark Post in TechnoratiFurl this Post!
Reply With Quote
Reply


Thread Tools
Display Modes

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

vB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are On
Forum Jump


All times are GMT. The time now is 06:10 AM.


Powered by vBulletin® Version 3.6.5
Copyright ©2000 - 2008, Jelsoft Enterprises Ltd.
SEO by vBSEO 3.2.0
www.UnixAdminTalk.com