LinuxQuestions.org
Latest LQ Deal: Linux Power User Bundle
Go Back   LinuxQuestions.org > Forums > Linux Forums > Linux - Newbie
User Name
Password
Linux - Newbie This 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


Reply
  Search this Thread
Old 03-08-2012, 03:01 AM   #1
ravirao1981
LQ Newbie
 
Registered: Mar 2012
Posts: 8

Rep: Reputation: Disabled
Unhappy Multiple instances of crond - what are the implications?


Hi,

I have a few scripts scheduled to run at different time of a day.
Sometimes I see multiple instance of cron daemon i.e one daemon has spawned another one and one of them is hung.
For example

root@localhost:/opt/fgw_instance_running/tools/SystemStats# ps -eaf | grep -i "cron"
root 5096 1 0 Mar06 ? 00:00:00 crond
root 15013 5096 0 08:01 ? 00:00:00 crond
root 15020 15013 0 08:01 ? 00:00:00 /bin/bash /usr/bin/run-parts /etc/cron.hourly

Can you please let me know why this may happen and how to resolve this?


Thanks,
Ravi
 
Old 03-08-2012, 03:12 AM   #2
Dark_Helmet
Senior Member
 
Registered: Jan 2003
Posts: 2,786

Rep: Reputation: 373Reputation: 373Reputation: 373Reputation: 373
What makes you think it's hung? Just because the process was started on March 6?

Here's a look at my system:
Code:
user@localhost$ uptime
 02:14:23 up 19 days,  5:59,  3 users,  load average: 1.00, 1.89, 2.75
user@localhost$ date
Thu Mar  8 02:15:02 CST 2012
user@localhost$ date -d 'today - 19 days - 5 hours - 59 minutes'
Sat Feb 17 20:15:46 CST 2012
user@localhost$ ps -eaf | grep -i "cron"
root      1586     1  0 Feb17 ?        00:00:01 /usr/sbin/cron
As the output shows, the crond daemon was started the last time my system was booted. I suspect that it will remain active until the system is turned off. Just because a process is "old" does not necessarily mean it has "hung."

Last edited by Dark_Helmet; 03-08-2012 at 03:20 AM.
 
Old 03-08-2012, 03:29 AM   #3
ravirao1981
LQ Newbie
 
Registered: Mar 2012
Posts: 8

Original Poster
Rep: Reputation: Disabled
Thanks for the quick reply.
It mean one of the scripts run by crond was hung, not crond itself. Sorry my bad.
Let me clarify.

I have a job(shell script) scheduled to run every 1 hour. This script will check the size of a directory every hour and if the size is greater than 500Mb, that dir is archived. I have this script running normally for weeks now.
Sometimes this script may take more time to complete the taring and meanwhile crond is spawned again(as you can see in above post). The new crond has the ppid of previous crond.
One of this crond is inactive(meaning, when I restart the cron using /etc/init.d/crond stop, only one of the process is stopped).
Also, is it ok to have multiple instance of crond? I checked the source of crond and there already is a mechanhism to prevent invocation of a instance when there is already one running.
Hope I am clear with my issue.
 
  


Reply


Thread Tools Search this Thread
Search this Thread:

Advanced Search

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
Multiple instances tekmann33 Linux - Newbie 1 01-28-2008 04:05 PM
kickstart; how-to info needed for multiple instances of RH OS's and multiple unique v Joe_Wulf Linux - Server 4 06-22-2007 12:18 AM
SAMBA: Multiple Instances? Matir Linux - Software 0 02-18-2005 11:43 AM
Mplayer and Multiple instances Spaz007 Linux - Software 0 09-16-2004 11:59 PM
Multiple instances of same user justinv Linux - General 7 01-19-2003 05:05 PM

LinuxQuestions.org > Forums > Linux Forums > Linux - Newbie

All times are GMT -5. The time now is 02:17 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
Facebook: linuxquestions Google+: linuxquestions
Open Source Consulting | Domain Registration