crond has improper locking preventing multiple daemons from running

Solution Unverified - Updated -

Issue

There are two issues here with cronie-1.4.4-12.el6.x86_64.

  1. If a child CROND process is killed, it removes the parents pid/lock file.
  2. If the pid/lock file is removed, multiple crond's can be running.
EXAMPLE ISSUE #1
[root@pocvm1w106m7 ~]# service crond status
crond (pid  6211) is running...
[root@pocvm1w106m7 ~]# ps -ef |egrep 'crond|CROND|sleep'
root      6211     1  0 Mar04 ?        00:00:07 crond -m off
root     30573  6211  0 13:55 ?        00:00:00 CROND -m off
root     30575 30573  0 13:55 ?        00:00:00 sleep 120
root     30576  6211  0 13:56 ?        00:00:00 CROND -m off
root     30577 30576  0 13:56 ?        00:00:00 sleep 120
root     30590 30549  0 13:56 pts/0    00:00:00 egrep crond|CROND|sleep
[root@pocvm1w106m7 ~]# kill 30573 30576
[root@pocvm1w106m7 ~]# service crond status
crond dead but subsys locked
[root@pocvm1w106m7 ~]# ps -ef |egrep 'crond|CROND|sleep'
root      6211     1  0 Mar04 ?        00:00:07 crond -m off
root     30575     1  0 13:55 ?        00:00:00 sleep 120
root     30577     1  0 13:56 ?        00:00:00 sleep 120
root     30600 30549  0 13:56 pts/0    00:00:00 egrep crond|CROND|sleep


EXAMPLE ISSUE #2
[root@pocvm1w106m7 ~]# service crond start
Starting crond:                                            [  OK  ]
[root@pocvm1w106m7 ~]# service crond status
crond (pid  30615) is running...
[root@pocvm1w106m7 ~]# ps -ef |egrep 'crond|CROND|sleep'
root      6211     1  0 Mar04 ?        00:00:07 crond -m off
root     30601  6211  0 13:57 ?        00:00:00 CROND -m off
root     30602 30601  0 13:57 ?        00:00:00 sleep 120
root     30603  6211  0 13:58 ?        00:00:00 CROND -m off
root     30604 30603  0 13:58 ?        00:00:00 sleep 120
root     30615     1  0 13:58 ?        00:00:00 crond -m off
root     30626 30549  0 13:58 pts/0    00:00:00 egrep crond|CROND|sleep

Environment

  • Red Hat Enterprise Linux 6
  • cronie

Subscriber exclusive content

A Red Hat subscription provides unlimited access to our knowledgebase of over 48,000 articles and solutions.

Current Customers and Partners

Log in for full access

Log In
Close

Welcome! Check out the Getting Started with Red Hat page for quick tours and guides for common tasks.