Red Hat Bugzilla – Bug 919440
cronie: prevent new crond process when already running
Last modified: 2013-11-21 17:24:35 EST
Description of problem: In RHEL 6, we can start multiple instances of crond just by running command "crond" in a shell, even if the service is already running. Every cron job gets executed multiple times, function of the number of crond process running. This is not necessarily a bug. Multiple instances were prevented on RHEL5 / vixie-cron (see additional info). Version-Release number of selected component (if applicable): cronie-1.4.4-7.el6.x86_64 How reproducible: Always Steps to Reproduce: 1. service crond is running from boot time 2. ps -ef |grep crond show the 1 instance running 3. as root, type crond in a shell 4. ps -ef |grep crond show the 2 instances running Actual results: Every job get executed multiple times. This is function of the number of crond process. Expected results: It would be good to prevent running crond in a shell if the service is already started. Additional info: RHEL 5 (good behavior) ---------------------- [root@pom-demo-30 ~]$ rpm -qa |grep vixie-cron vixie-cron-4.1-81.el5 1 crond process running : [root@pom-demo-30 ~]# ps -ef |grep crond root 474 445 0 13:55 pts/0 00:00:00 grep crond root 2851 1 0 2012 ? 00:00:03 crond Start of another crond process prevented : [root@pom-demo-30 ~]# crond crond: can't lock /var/run/crond.pid, otherpid may be 2851: Resource temporarily unavailable Still 1 crond process : [root@pom-demo-30 ~]# ps -ef |grep crond root 548 445 0 13:55 pts/0 00:00:00 grep crond root 2851 1 0 2012 ? 00:00:03 crond RHEL 6 ------ [root@pom302 ~]# rpm -qa |grep cronie cronie-noanacron-1.4.4-7.el6.x86_64 cronie-1.4.4-7.el6.x86_64 1 crond process running : [root@pom302 ~]# ps -ef |grep crond root 1274 1 0 14:00 ? 00:00:00 crond root 1885 1865 0 14:00 pts/0 00:00:00 grep crond Start of another crond process is *not* prevented : [root@pom302 ~]# crond [root@pom302 ~]# [root@pom302 ~]# ps -ef |grep crond root 1274 1 0 14:00 ? 00:00:00 crond root 2010 1 0 14:00 ? 00:00:00 crond root 2096 1865 0 14:00 pts/0 00:00:00 grep crond
Thank you for your report. That's really strange. Only one daemon should be running at time.
Since the problem described in this bug report should be resolved in a recent advisory, it has been closed with a resolution of ERRATA. For information on the advisory, and where to find the updated files, follow the link below. If the solution does not work for you, open a new bug report. http://rhn.redhat.com/errata/RHBA-2013-1681.html