Red Hat Bugzilla – Bug 137387
checkpid() does not check for the death of ALL threads belonging to a process.
Last modified: 2014-03-16 22:49:57 EDT
Description of problem:
checkpid() in /etc/init.d/functions is broken. It returns success if
any of a program's threads is no longer running. It should return
success only if all threads from a given program are no longer running.
This fails if one upgrades to OpenLDAP 2.2, as it's no longer possible
to shut down slurpd. slurpd fails to die on the TERM sent from
killproc(), but checkpid() erroneously reports that slurpd has been
shut down, because some (but not all) of its threads are no longer
active in /proc. For this reason, fallthrough to issuing a KILL never
Version-Release number of selected component (if applicable):
Steps to Reproduce:
1. Install OpenLDAP 2.2 as a master server, using slurpd for
replication. You can use the RPM from FC3.
2. Attempt to shut down the LDAP service, using the init script.
Observe with ps(1) that slurpd is still running.
slurpd should have been KILLed when it refused to be TERMinated.
Although OpenLDAP 2.2 is not a part of FC2, this problem has the
potential to occur with any threaded daemon that responds to a TERM by
shutting down some, but not all, of its threads.
I haven't checked the initscripts in FC3, but I suspect the problem is
still there in checkpid().
Created attachment 105876 [details]
This fixes the issue described in this bug.
Using this version of checkpid(), daemons which stop some, but not all, threads
after receiving a TERM are later properly sent a KILL to finish the job off.
This is fixed in current development packages (7.85 and later.)