I am getting the below error while starting openLDAP.
bdb_db_open: alock package is unstable
...
However, if I am using sudo access, I get no error and could
successfully start the server and search the DB.
The files in the openldap database directory should be owned by the user
that slapd will be run as. For example, if you run slapd as root with
"-u slapd" then the files and directory should be owned by user "slapd".
(Programs that access the database directly (e.g., slapcat, db_stat)
should be run as that same user so that they don't create files such as
txn logs with the wrong ownership. If slapd is running and you run
db_stat as root and it creates a txn log file as root, then slapd will
panic and will refuse to (re)start until you fix the ownership. I've seen
that happen on a completely different project using BDB.)
So, what arguments are you invoking slapd with and what are the
permissions and ownerships of the database directory and the files inside
it?