cmikk@qwest.net writes:
The patch at:
http://mikk.net/~chris/patches/0002-Remove-POSIX-semaphores-when-the-last-us...
Attempts to upgrade the lockfile lock to exclusive when closing the environment. If that upgrade succeeds, it removes the semaphores.
That won't help if the mdb proccess crashes. Sounds like mdb needs some cleanup API calls. Maybe one which does the same as your patch after opening the environment - except it does not create any files, and fails if the exclusive lock fails.