[Pkg-openldap-devel] r977 - openldap/trunk/debian

Steve Langasek vorlon at alioth.debian.org
Sun Jan 13 00:16:50 UTC 2008


Author: vorlon
Date: 2008-01-13 00:16:50 +0000 (Sun, 13 Jan 2008)
New Revision: 977

Modified:
   openldap/trunk/debian/slapd.scripts-common
Log:
put syncprov moduleload line at the top of the config file, since loading
it after a 'database' directive may not work in the future



Modified: openldap/trunk/debian/slapd.scripts-common
===================================================================
--- openldap/trunk/debian/slapd.scripts-common	2008-01-13 00:13:01 UTC (rev 976)
+++ openldap/trunk/debian/slapd.scripts-common	2008-01-13 00:16:50 UTC (rev 977)
@@ -435,7 +435,7 @@
 		use File::Compare;
 		use File::Copy;
 
-		$has_replica = $seen_syncprov = 0;
+		$has_replica = 0;
 		$backend_bdb = $backend_hdb = 0;
 		$checkpoint_bdb = "";
 		$checkpoint_hdb = "";
@@ -476,13 +476,8 @@
 					print $fh $_ . $checkpoint_hdb;
 					next;
 				}
-				$seen_syncprov = 1 if /^moduleload\s+syncprov/;
 				if (/^replica\s+/)
 				{
-					if (!$has_replica && !$seen_syncprov) {
-						print $fh "moduleload syncprov\n";
-						$seen_syncprov = 1;
-					}
 					print $fh "overlay syncprov\n";
 					print $fh "syncprov-checkpoint 100 10\n";
 					$has_replica = 1;
@@ -513,6 +508,22 @@
 		result=1
 	fi
 
+	if [ $result -eq 1 ] \
+	   && ! grep -q '^moduleload[[:space:]]\+syncprov' $SLAPD_CONF
+	then
+		# Create a temporary file for the new config
+		new_conf=`mktemp -q ${SLAPD_CONF}.XXXXXX`
+
+		# Prepend the module load command
+		echo '# load syncrepl provider support, replacing slurpd' > $new_conf
+		echo 'moduleload syncprov' >> $new_conf
+		echo >> $new_conf
+		cat $SLAPD_CONF >> $new_conf
+
+		# Activate the new configuration file
+		install_new_slapd_conf "$new_conf"
+	fi
+
 	echo . >&2
 
 	return $result




More information about the Pkg-openldap-devel mailing list