diff -Nur e-smith-ldap-5.4.0/root/etc/e-smith/templates/var/lib/ldap/DB_CONFIG/30logs e-smith-ldap-5.4.0_bz8621/root/etc/e-smith/templates/var/lib/ldap/DB_CONFIG/30logs --- e-smith-ldap-5.4.0/root/etc/e-smith/templates/var/lib/ldap/DB_CONFIG/30logs 2013-02-13 16:21:49.000000000 +0100 +++ e-smith-ldap-5.4.0_bz8621/root/etc/e-smith/templates/var/lib/ldap/DB_CONFIG/30logs 2014-10-24 09:52:42.128000000 +0200 @@ -5,4 +5,5 @@ set_lg_max 10485760 set_lg_bsize 2097152 set_lg_dir /var/log/bdb - +set_flags DB_LOG_AUTOREMOVE +txn_checkpoint 256 5 0 diff -Nur e-smith-ldap-5.4.0/root/var/service/ldap/finish e-smith-ldap-5.4.0_bz8621/root/var/service/ldap/finish --- e-smith-ldap-5.4.0/root/var/service/ldap/finish 2014-10-24 09:50:59.766000000 +0200 +++ e-smith-ldap-5.4.0_bz8621/root/var/service/ldap/finish 2014-10-24 09:59:18.774000000 +0200 @@ -1,5 +1,22 @@ #! /bin/sh -/usr/sbin/slaptest -u 2>/dev/null && \ - /usr/sbin/slapcat -l ldif && \ - /usr/bin/db_archive -d -h /var/log/bdb/ +exec 2>&1 + +LDIF=$(readlink -n ldif) +TMP=$LDIF.$$ +if /usr/sbin/slapcat -l $TMP +then + mv -f $TMP $LDIF +else + echo slapcat dump of ldif failed - shutting down ldap service >&2 + echo probable corruption of ldap backend files >&2 + + # Don't bother to keep a zero length dump file + if test ! -s $TMP + then + rm -f $TMP + fi + + # shut down service if slapcat is failing + sv d . +fi