The slapd startup script searches for the location of the database directory with the line DATABASEDIR=`grep olcDbDirectory /usr/local/etc/openldap/slapd.d/cn=config/olcDatabase=* | awk '{ print $2 }'` This assumes that the objects olcDatabase=* are files, but they needn't be. For example % ls -d1 /usr/local/etc/openldap/slapd.d/cn=config/olcDatabase=* /usr/local/etc/openldap/slapd.d/cn=config/olcDatabase={-1}frontend.ldif /usr/local/etc/openldap/slapd.d/cn=config/olcDatabase={0}config.ldif /usr/local/etc/openldap/slapd.d/cn=config/olcDatabase={1}mdb/ /usr/local/etc/openldap/slapd.d/cn=config/olcDatabase={1}mdb.ldif /usr/local/etc/openldap/slapd.d/cn=config/olcDatabase={2}mdb/ /usr/local/etc/openldap/slapd.d/cn=config/olcDatabase={2}mdb.ldif (the extra databases are for accesslog and syncprov) This produces warnings when the script is used: % service slapd stop grep: /usr/local/etc/openldap/slapd.d/cn=config/olcDatabase={1}mdb: Is a directory grep: /usr/local/etc/openldap/slapd.d/cn=config/olcDatabase={2}mdb: Is a directory Stopping slapd. Waiting for PIDS: 72659. A suitable alternative might be: % find /usr/local/etc/openldap/slapd.d/cn=config -name olcDatabase=\*.ldif|xargs grep olcDbDirectory This is in the port of openldap26-server-2.6.0, in 13.0-RELEASE.
*** Bug 261793 has been marked as a duplicate of this bug. ***
Sorry for the duplicate. I submitted the first one, but got a big red warning about an invalid token (?), so I assumed the submission had failed and did it again (I'd fortunately/automatically copied the body text!).
Note that this also affects net/openldap25-server
I have the same issue and used grep -r option as workaround here a diff --- slapd.orig 2023-07-26 20:40:23.461548000 +0300 +++ slapd 2023-07-26 21:16:31.057004000 +0300 @@ -71,7 +71,7 @@ if checkyesno slapd_cn_config; then required_dirs="/usr/local/etc/openldap/slapd.d" required_files="/usr/local/etc/openldap/slapd.d/cn=config.ldif" - DATABASEDIR=`grep olcDbDirectory /usr/local/etc/openldap/slapd.d/cn=config/olcDatabase=* | awk '{ print $2 }'` + DATABASEDIR=`grep -r olcDbDirectory /usr/local/etc/openldap/slapd.d/cn=config/olcDatabase=* | awk '{ print $2 }'` else required_files="/usr/local/etc/openldap/slapd.conf" DATABASEDIR=`awk '$1 == "directory" { print $2 }' "/usr/local/etc/openldap/slapd.conf" 2>&1 /dev/null`
Created attachment 248207 [details] Fix grep error message I just run into the same problem. Based on the workaround of Zeus i created a patch for openldap25 and openldap26.