[Date Prev][Date Next]
(ITS#7364) mdb: clean up POSIX semaphores on environment close.
- To: openldap-its@OpenLDAP.org
- Subject: (ITS#7364) mdb: clean up POSIX semaphores on environment close.
- From: email@example.com
- Date: Wed, 22 Aug 2012 22:05:53 GMT
- Auto-submitted: auto-generated (OpenLDAP-ITS)
Full_Name: Chris Mikkelson
Submission from: (NULL) (188.8.131.52)
When a back-mdb database is closed, the POSIX semaphores created when the mdb
database was opened are left behind. This prevents a different user from opening
For example, if you run slapd as an unprivileged user, stop slapd, and do an
offline slapcat as root, slapd will not start up again as that unprivileged
user. The only ways to recover I've found are:
a) reboot the machine
b) restore the database from the slapcat, ensuring that slapadd runs as the
correct user, or
c) write a small program to re-generate the semaphore names an remove them.
The patch at:
Attempts to upgrade the lockfile lock to exclusive when closing the environment.
If that upgrade succeeds, it removes the semaphores.
Patch has been tested on a BSD system. WIN32 has not been tested.