[Pkg-openldap-devel] Bug#436954: slapd: wishlist item: re-index at startup
Andreas John
aj at net-lab.net
Thu Aug 9 17:31:49 UTC 2007
Package: slapd
Version: 2.3.30-5, probably all newer ones.
severity: wishlist
Hello,
as slapd fails from time to time in maintaining it's indexes correctly,
I would like to see a config option in /etc/default/slapd, to make it
re-index at startup time. The behavior should be configurable in
/etc/default/slapd.
Two patches attached.
rgds,
Andreas
--- /etc/default/slapd.orig 2007-08-09 18:44:35.000000000 +0200
+++ /etc/default/slapd 2007-08-09 19:01:21.000000000 +0200
@@ -9,6 +9,10 @@
# run in the primary group of its user.
SLAPD_GROUP="openldap"
+# Set this to true, if you want the indexes to be reindexed at startup
+# Needs sudo to be installed. (apt-get install sudo or such)
+SLAPINDEX_ON_START=
+
# Path to the pid file of the slapd server. If not set the init.d script
# will try to figure it out from $SLAPD_CONF (/etc/ldap/slapd.conf)
SLAPD_PIDFILE=
--- /etc/init.d/slapd.orig 2007-08-09 18:25:32.000000000 +0200
+++ /etc/init.d/slapd 2007-08-09 19:18:33.000000000 +0200
@@ -128,6 +128,16 @@
# Start the slapd daemon and capture the error message if any to
# $reason.
start_slapd() {
+ # (re-)creates indexes, if configured so in /etc/default/slapd
+ # indexes in slapd a known to misbehave from time to time. -aj
+ if [ ! -z "${SLAPINDEX_ON_START}" ]; then
+ if [ -z "$SLAPD_USER" ]; then
+ /usr/sbin/slapindex
+ else
+ [ -f "/usr/sbin/slapd" ] && sudo -u
"$SLAPD_USER" /usr/sbin/slapindex
+ fi
+ fi
+
echo -n " slapd"
if [ -z "$SLAPD_SERVICES" ]; then
reason="`start-stop-daemon --start --quiet --oknodo \
More information about the Pkg-openldap-devel
mailing list