[Pkg-openldap-devel] [openldap] 19/29: r1565 at pulsar: torsten | 2005-03-26 01:55:05 +0100 * Install an example DB_CONFIG file during initial configuration + slapd.postinst: Add a function to implement this and hook it into create_new_configuration. + debian/DB_CONFIG: Example DB_CONFIG that is installed. + debian/slapd.examples: Mark DB_CONFIG as an example.

Timo Aaltonen tjaalton-guest at alioth.debian.org
Thu Oct 10 05:34:51 UTC 2013


This is an automated email from the git hooks/post-receive script.

tjaalton-guest pushed a commit to annotated tag 2.2.23-0.pre6
in repository openldap.

commit 7b3cea8ea37ba6b6eb4e320bb676700b0ddba4cc
Author: Torsten Landschoff <torsten at debian.org>
Date:   Sat Mar 26 00:58:35 2005 +0000

     r1565 at pulsar:  torsten | 2005-03-26 01:55:05 +0100
      * Install an example DB_CONFIG file during initial configuration
        + slapd.postinst: Add a function to implement this and hook it into
          create_new_configuration.
        + debian/DB_CONFIG: Example DB_CONFIG that is installed.
        + debian/slapd.examples: Mark DB_CONFIG as an example.
---
 debian/DB_CONFIG      |   59 +++++++++++++++++++++++++++++++++++++++++++++++++
 debian/changelog      |    5 +++++
 debian/slapd.examples |    1 +
 debian/slapd.postinst |   21 ++++++++++++++++++
 4 files changed, 86 insertions(+)

diff --git a/debian/DB_CONFIG b/debian/DB_CONFIG
new file mode 100644
index 0000000..aa805a9
--- /dev/null
+++ b/debian/DB_CONFIG
@@ -0,0 +1,59 @@
+# WARNING: Before tuning the following parameters, _PLEASE READ_
+#   http://www.openldap.org/faq/data/cache/1075.html
+
+# Set the database in memory cache size.
+#
+# set_cachesize <gbytes> <bytes> <ncache>
+#   Sets the database in memory cache size. 
+#   Database entries and indexes will be stored in this cache to 
+#   avoid disk access during database read and write operations. 
+#   Tuning this value can greatly effect your database performance. 
+#   The parameters are:
+#      <gbytes>: The number of gigabytes of memory to allocate to the cache.
+#      <bytes>: The number of bytes of memory to allocate to the cache.
+#      <ncache>: The number of cache segments to use. If this value is set to 
+#          0 or 1 then Berkeley DB will try to allocate one contiguous section 
+#          of memory for the cache. If this value is greater than 1, the cache 
+#          will be split into that number of segments.
+#set_cachesize   0       52428800        0
+
+# Sets the database startup flags.
+#
+# set_flags <flag>
+#   There are various flag options that may be set. The DB_TXN_NOSYNC flag 
+#   tells the database not to immediately flush transaction buffers to disk. 
+#   Setting this flag can help speed up database access during periods of 
+#   database write activity BUT at expense of data safety. Enable it only
+#   to load data with slapadd, while slapd is not running.
+#set_flags       DB_TXN_NOSYNC
+
+
+# Set the maximum in memory cache in <bytes> for database file name caching.
+#
+# set_lg_regionmax <bytes>
+#   This value should be increased as the number of database files increases 
+#   (tables and indexes).
+#set_lg_regionmax        1048576
+
+# Set the maximum size of log files in <bytes>.
+#
+# set_lg_max <bytes>
+#   Logs will be rotated when <bytes> amount of data have been written to 
+#   one log file. This value should be at least four times the size of 
+#   set_lg_bsize.
+#set_lg_max              10485760
+
+# Set the in memory cache for log information.
+#
+# set_lg_bsize <bytes>
+#   When <bytes> amount of logging information have been written to this 
+#   cache it will be flushed to disk.
+#set_lg_bsize            2097152
+
+# Set the log file directory to <directory>. 
+#
+# set_lg_dir              /usr/local/var/openldap-logs
+#   Log files should preferably be on a different disk than the 
+#   database files. This both improves reliability (for disastrous
+#   recovery) and speed of the database.
+#set_lg_dir <directory>
diff --git a/debian/changelog b/debian/changelog
index 8f62a83..f4f296c 100644
--- a/debian/changelog
+++ b/debian/changelog
@@ -30,6 +30,11 @@ openldap2.2 (2.2.23-0.pre6) experimental; urgency=low
   * debian/slapd.postinst: Handle hdb backend just as if it was bdb.
   * debian/README.Debian: Add some notes about DB_CONFIG and how to run
     slapd under a different uid/gid.
+  * Install an example DB_CONFIG file during initial configuration
+    + slapd.postinst: Add a function to implement this and hook it into
+      create_new_configuration.
+    + debian/DB_CONFIG: Example DB_CONFIG that is installed.
+    + debian/slapd.examples: Mark DB_CONFIG as an example.
 
  -- 
 
diff --git a/debian/slapd.examples b/debian/slapd.examples
new file mode 100644
index 0000000..1e965f0
--- /dev/null
+++ b/debian/slapd.examples
@@ -0,0 +1 @@
+debian/DB_CONFIG
diff --git a/debian/slapd.postinst b/debian/slapd.postinst
index 369e8c4..2ab3da8 100644
--- a/debian/slapd.postinst
+++ b/debian/slapd.postinst
@@ -88,6 +88,26 @@ manual_configuration_wanted() {						# {{{
 	fi
 }
 # }}}
+copy_example_DB_CONFIG() {						# {{{
+# Copy an example DB_CONFIG file, only if available
+# copy_example_DB_CONFIG <directory>
+	local directory srcdir
+	
+	directory="$1"
+	srcdir="/usr/share/doc/slapd/examples"
+
+	if ! [ -f "${directory}/DB_CONFIG" ] && [ -d "$directory" ]; then
+		if [ -r "$srcdir/DB_CONFIG" ]; then
+		 	cp $src/DB_CONFIG "${directory}/DB_CONFIG"
+		fi
+
+		if [ -r "$srcdir/DB_CONFIG.gz" ]; then
+			zcat $srcdir/DB_CONFIG.gz > "${directory}/DB_CONFIG"
+		fi
+	fi
+}
+
+# }}}
 create_new_configuration() {						# {{{
 # Create a new configuration and directory
 
@@ -114,6 +134,7 @@ create_new_configuration() {						# {{{
 	move_old_database_away /var/lib/ldap
 	create_new_slapd_conf "$basedn" "$backend"
 	create_new_directory "$basedn" "$dc"
+	copy_example_DB_CONFIG /var/lib/ldap
 }
 # }}}
 create_new_slapd_conf() {						# {{{

-- 
Alioth's /usr/local/bin/git-commit-notice on /srv/git.debian.org/git/pkg-openldap/openldap.git



More information about the Pkg-openldap-devel mailing list