Gentoo Websites Logo
Go to: Gentoo Home Documentation Forums Lists Bugs Planet Store Wiki Get Gentoo!
Bug 545792 - net-nds/openldap-2.4.40-r3 incorrect checkconfig() in /etc/init.d/slapd
Summary: net-nds/openldap-2.4.40-r3 incorrect checkconfig() in /etc/init.d/slapd
Status: RESOLVED FIXED
Alias: None
Product: Gentoo Linux
Classification: Unclassified
Component: Current packages (show other bugs)
Hardware: All Linux
: Normal normal (vote)
Assignee: Gentoo LDAP project
URL:
Whiteboard:
Keywords:
Depends on:
Blocks:
 
Reported: 2015-04-07 07:08 UTC by Dmitry A. Bakshaev
Modified: 2015-07-13 07:41 UTC (History)
1 user (show)

See Also:
Package list:
Runtime testing required: ---


Attachments
fix checkconfig() (slapd-initd-2.4.40-r1.patch,1.35 KB, patch)
2015-04-07 07:11 UTC, Dmitry A. Bakshaev
Details | Diff

Note You need to log in before you can comment on or make changes to this bug.
Description Dmitry A. Bakshaev 2015-04-07 07:08:30 UTC
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
Comment 1 Dmitry A. Bakshaev 2015-04-07 07:11:01 UTC
Created attachment 400746 [details, diff]
fix checkconfig()
Comment 2 Marios Andreopoulos 2015-04-28 21:04:20 UTC
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
Comment 3 Patrick Lauer gentoo-dev 2015-07-13 07:41:25 UTC
+  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