initscript: slaptest with '-u' to skip database opening
Resolves: #667768
This commit is contained in:
parent
40bc33f600
commit
edebe64186
10
ldap.init
10
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
|
||||
|
Loading…
Reference in New Issue
Block a user