Bug 261793 - net/openldap26-server /usr/local/etc/rc.d/slapd assumes cn=config/olcDatabase=* are files
Summary: net/openldap26-server /usr/local/etc/rc.d/slapd assumes cn=config/olcDatabase...
Status: Closed DUPLICATE of bug 261792
Alias: None
Product: Ports & Packages
Classification: Unclassified
Component: Individual Port(s) (show other bugs)
Version: Latest
Hardware: Any Any
: --- Affects Only Me
Assignee: Xin LI
URL:
Keywords:
Depends on:
Blocks:
 
Reported: 2022-02-08 15:32 UTC by Norman Gray
Modified: 2022-02-08 15:36 UTC (History)
1 user (show)

See Also:
bugzilla: maintainer-feedback? (delphij)


Attachments

Note You need to log in before you can comment on or make changes to this bug.
Description Norman Gray 2022-02-08 15:32:27 UTC
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 for the port of openldap26-server-2.6.0, in 13.0-RELEASE.
Comment 1 Li-Wen Hsu freebsd_committer freebsd_triage 2022-02-08 15:36:04 UTC

*** This bug has been marked as a duplicate of bug 261792 ***