From edebe64186ea94adc2dad15df8a14efff75c21aa Mon Sep 17 00:00:00 2001 From: Jan Vcelak Date: Thu, 6 Jan 2011 19:19:07 +0100 Subject: [PATCH] initscript: slaptest with '-u' to skip database opening Resolves: #667768 --- ldap.init | 10 +--------- 1 file changed, 1 insertion(+), 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