[openldap] initscript: slaptest with '-u' to skip database opening

jvcelak jvcelak at fedoraproject.org
Thu Jan 6 20:01:35 UTC 2011


commit edebe64186ea94adc2dad15df8a14efff75c21aa
Author: Jan Vcelak <jvcelak at redhat.com>
Date:   Thu Jan 6 19:19:07 2011 +0100

    initscript: slaptest with '-u' to skip database opening
    
    Resolves: #667768

 ldap.init |   10 +---------
 1 files changed, 1 insertions(+), 9 deletions(-)
---
diff --git a/ldap.init b/ldap.init
index f790f68..1c2fe62 100644
--- a/ldap.init
+++ b/ldap.init
@@ -110,7 +110,6 @@ function configtest() {
 	prog=`basename ${slapd}`
 	ldapuid=`id -u $user`
 	# Unaccessible database files.
-	slaptestflags=""
 	dbdirs=""
 	if [ -d $configdir ]; then
 		for configfile in `ls -1 $configdir/cn\=config/olcDatabase*.ldif`; do
@@ -129,13 +128,6 @@ function configtest() {
 		for file in `find ${dbdir}/ -not -uid $ldapuid -and \( -name "*.dbb" -or -name "*.gdbm" -or -name "*.bdb" -or -name "__db.*" -or -name "log.*" -or -name alock \)` ; do
 			echo -n $"$file is not owned by \"$user\"" ; warning ; echo
 		done
-		if ! test -s ${dbdir}/id2entry.dbb ; then
-			if ! test -s ${dbdir}/id2entry.gdbm ; then
-				if ! test -s ${dbdir}/id2entry.bdb ; then
-					slaptestflags="-u"
-				fi
-			fi
-		fi
 		if test -f "${dbdir}/DB_CONFIG"; then
 			if ! testasuser $user -r "${dbdir}/DB_CONFIG"; then
 				file=DB_CONFIG
@@ -167,7 +159,7 @@ function configtest() {
 		fi
 	done
 	# Check the configuration file.
-	slaptestout=`/sbin/runuser -m -s "$slaptest" -- "$user" $slaptestflags 2>&1`
+	slaptestout=`/sbin/runuser -m -s "$slaptest" -- "$user" "-u" 2>&1`
 	slaptestexit=$?
 #	slaptestout=`echo $slaptestout 2>/dev/null | grep -v "config file testing succeeded"`
 	# print warning if slaptest passed but reports some problems


More information about the scm-commits mailing list