slapd do not start Reproducible: Always Steps to Reproduce: 1. /etc/init.d/slapd -d start Actual Results: ... + CONF=/etc/openldap/slapd.conf + '[' -d /etc/openldap/slapd.conf ']' ++ eval awk '"/^(directory|olcDbDirectory:)/{print $2}"' /etc/openldap/slapd.conf +++ awk '/^(directory|olcDbDirectory:)/{print }' /etc/openldap/slapd.conf + DBDIRS='directory /var/lib/openldap-ldbm' + for d in '$DBDIRS' + '[' '!' -d directory ']' + eerror 'Directory directory in config does not exist!' * Directory directory in config does not exist! + return 1 + eerror 'There is a problem with your slapd.conf!' * There is a problem with your slapd.conf! + return 1 + exit 1 * ERROR: slapd failed to start Expected Results: config file testing succeeded * Starting ldap-server ... [ ok ] file owner check with inverted logic
Created attachment 400746 [details, diff] fix checkconfig()
I can confirm this bug and part of the fix (line 51, DBDIRS assignment). What's interesting is that running the offending line 51 from the init script on a bash terminal it returns the expected results. Only when it runs as an init script it returns the wrong results. LINE 51: DBDIRS=`eval awk '"/^(directory|olcDbDirectory:)/{print \$2}"' $CONF` From bash returns correctly the directory : /var/lib/openldap-data From init script returns the whole conf line: directory /var/lib/openldap-data
+ 13 Jul 2015; Patrick Lauer <patrick@gentoo.org> +files/slapd-initd-2.4.40-r2, + +openldap-2.4.40-r4.ebuild, -openldap-2.4.40-r3.ebuild: + Fix init script failure #545792