Linode Forum
Linode Community Forums
 FAQFAQ    SearchSearch    MembersMembers      Register Register 
 LoginLogin [ Anonymous ] 
Post new topic  Reply to topic
Author Message
PostPosted: Thu Aug 11, 2011 7:27 pm 
Offline
Senior Member

Joined: Thu Jul 22, 2010 8:23 pm
Posts: 60
I have an intermittent problem where crond dies.

Is there a way to respawn a daemon that dies in Centos?

Ta


Top
   
 Post subject:
PostPosted: Thu Aug 11, 2011 7:35 pm 
Offline
Senior Member
User avatar

Joined: Sat Aug 30, 2008 1:55 pm
Posts: 1739
Location: Rochester, New York
You could probably just set up a cron job that restarts it if it isn't running.

_________________
Code:
/* TODO: need to add signature to posts */


Top
   
 Post subject:
PostPosted: Thu Aug 11, 2011 7:39 pm 
Offline
Senior Member
User avatar

Joined: Sat Aug 30, 2008 1:55 pm
Posts: 1739
Location: Rochester, New York
I apologize for my previous answer. Been waiting a very long time to use that one.

... but for good reason. Cron is usually solid as a rock, and shouldn't be dying unless there's something seriously bad going on. You probably want to figure out why it crashes and address that.

Another idea might be to write a daemon that periodically checks to ensure cron is running.

_________________
Code:
/* TODO: need to add signature to posts */


Top
   
 Post subject:
PostPosted: Thu Aug 11, 2011 7:46 pm 
Offline
Senior Member

Joined: Thu Jul 22, 2010 8:23 pm
Posts: 60
BOOM-TISH hoopy :)

Well, where should I start looking to see why it died? cron logs show nothing.....


Top
   
 Post subject:
PostPosted: Thu Aug 11, 2011 9:10 pm 
Offline
Senior Member
User avatar

Joined: Sat Aug 30, 2008 1:55 pm
Posts: 1739
Location: Rochester, New York
Any pattern to it? Anything else dying? Hitting the oom-killer or anything like that?

_________________
Code:
/* TODO: need to add signature to posts */


Top
   
 Post subject:
PostPosted: Thu Aug 11, 2011 9:28 pm 
Offline
Senior Member

Joined: Thu Jul 22, 2010 8:23 pm
Posts: 60
it is a rather boring setup, without enough punishment to OOM.

I have cron executing a php script every 2 minutes and i log the results to a file.

The only thing I can think of is when i logrotate this particular log file.. there may be a collision with the cron daemon if they both want access to the file at the same time.

I have no idea whether cron and logrotate can collide in this siutation.


Top
   
 Post subject:
PostPosted: Sat Aug 13, 2011 12:45 am 
Offline
Senior Member
User avatar

Joined: Sun Jan 18, 2009 2:41 pm
Posts: 830
You could use something like monit to monitor/restart crond. But if something's killing off crond, there's no guarantee it won't kill off the monit daemon as well.

Another option might be using inittab to respawn crond if it dies.


Top
   
 Post subject:
PostPosted: Sat Aug 13, 2011 1:01 pm 
Offline
Senior Member
User avatar

Joined: Sat Aug 30, 2008 1:55 pm
Posts: 1739
Location: Rochester, New York
Cron usually doesn't write to log files directly (it uses syslog), and even if something it spawns crashes, the problem will be isolated to that process.

Might be worth checking your distribution's bug tracker, and opening a bug report if it's not a known issue. All software has bugs, and this sounds like one! -rt

_________________
Code:
/* TODO: need to add signature to posts */


Top
   
Display posts from previous:  Sort by  
Post new topic  Reply to topic


Who is online

Users browsing this forum: No registered users and 4 guests


You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum

Search for:
Jump to:  
RSS

Powered by phpBB® Forum Software © phpBB Group