[Pkg-openldap-devel] Bug#593880: cleanup the logic in slapd's init script a bit
Peter Marschall
peter at adpm.de
Sat Aug 21 20:01:03 UTC 2010
Package: slapd
Version: 2.4.23-3pm1
Severity: minor
Tags: sid patch
Hi Matthijs & the other openldap maintainers,
looking at slapd's init script I found a potential bug.
currently slapd's init script only sets the correct option for $SLAPD_CONF
(i-e- -f / -F depending on the type) if $SLAPD_PIDFILE is not set.
In my opinion this logic should be separated.
The patch attached to this bug does exactly this.
Best regards
Peter
-- System Information:
Debian Release: squeeze/sid
APT prefers testing
APT policy: (990, 'testing'), (500, 'unstable'), (500, 'stable')
Architecture: amd64 (x86_64)
Kernel: Linux 2.6.32-5-amd64 (SMP w/4 CPU cores)
Locale: LANG=de_DE.UTF-8, LC_CTYPE=de_DE.UTF-8 (charmap=UTF-8)
Shell: /bin/sh linked to /bin/dash
Versions of packages slapd depends on:
ii adduser 3.112 add and remove users and groups
ii coreutils 8.5-1 GNU core utilities
ii debconf [debconf-2.0] 1.5.35 Debian configuration management sy
ii libc6 2.11.2-2 Embedded GNU C Library: Shared lib
ii libdb4.8 4.8.30-1 Berkeley v4.8 Database Libraries [
ii libgnutls26 2.8.6-1 the GNU TLS library - runtime libr
ii libldap-2.4-2 2.4.23-3pm1 OpenLDAP libraries
ii libltdl7 2.2.6b-2 A system independent dlopen wrappe
ii libperl5.10 5.10.1-14 shared Perl library
ii libsasl2-2 2.1.23.dfsg1-5 Cyrus SASL - authentication abstra
ii libslp1 1.2.1-7.7 OpenSLP libraries
ii libwrap0 7.6.q-19 Wietse Venema's TCP wrappers libra
ii lsb-base 3.2-23.1 Linux Standard Base 3.2 init scrip
ii perl [libmime-base64-perl 5.10.1-14 Larry Wall's Practical Extraction
ii psmisc 22.11-1 utilities that use the proc file s
ii unixodbc 2.2.14p2-1 ODBC tools libraries
Versions of packages slapd recommends:
ii libsasl2-modules 2.1.23.dfsg1-5 Cyrus SASL - pluggable authenticat
Versions of packages slapd suggests:
ii ldap-utils 2.4.23-3pm1 OpenLDAP utilities
-- Configuration Files:
/etc/default/slapd changed:
SLAPD_CONF="/etc/ldap/slapd.d"
SLAPD_USER="openldap"
SLAPD_GROUP="openldap"
SLAPD_PIDFILE=
SLAPD_SERVICES="ldap:/// ldaps:/// ldapi:///"
SLAPD_SENTINEL_FILE=/etc/ldap/noslapd
export KRB5_KTNAME="FILE:/etc/ldap/slapd.keytab"
SLAPD_OPTIONS="-o slp=(tree=experimental),(server-type=OpenLDAP),(server-version=2.4.23)"
-- debconf information:
slapd/tlsciphersuite:
shared/organization: adpm.de
slapd/upgrade_slapcat_failure:
slapd/backend: HDB
slapd/allow_ldap_v2: false
slapd/no_configuration: false
slapd/move_old_database: true
slapd/suffix_change: false
slapd/dump_database_destdir: /var/backups/slapd-VERSION
slapd/domain: adpm.de
slapd/password_mismatch:
slapd/invalid_config: true
slapd/slurpd_obsolete:
slapd/dump_database: when needed
slapd/migrate_ldbm_to_bdb: false
slapd/purge_database: false
-------------- next part --------------
--- openldap-2.4.23/debian/slapd.init
+++ openldap-2.4.23/debian/slapd.init
@@ -38,9 +38,16 @@
SLAPD_CONF="/etc/ldap/slapd.conf"
fi
+# extend options depending on config type
+if [ -f "$SLAPD_CONF" ]; then
+ SLAPD_OPTIONS="-f $SLAPD_CONF $SLAPD_OPTIONS"
+elif [ -d "$SLAPD_CONF" ] ; then
+ SLAPD_OPTIONS="-F $SLAPD_CONF $SLAPD_OPTIONS"
+fi
+
# Stop processing if the config file is not there
if [ ! -r "$SLAPD_CONF" ]; then
- log_warning_msg "No configuration file was found for slapd at $SLAPD_CONF."
+ log_warning_msg "No configuration was found for slapd at $SLAPD_CONF."
exit 1
fi
@@ -50,13 +57,11 @@
if [ -f "$SLAPD_CONF" ] ; then
SLAPD_PIDFILE=`sed -ne 's/^pidfile[[:space:]]\+\(.\+\)/\1/p' \
"$SLAPD_CONF"`
- SLAPD_OPTIONS="-f $SLAPD_CONF $SLAPD_OPTIONS"
# Else, if using new directory configuration scheme
elif [ -d "$SLAPD_CONF" ] ; then
SLAPD_PIDFILE=`sed -ne \
's/^olcPidFile:[[:space:]]\+\(.\+\)[[:space:]]*/\1/p' \
"$SLAPD_CONF"/'cn=config.ldif'`
- SLAPD_OPTIONS="-F $SLAPD_CONF $SLAPD_OPTIONS"
fi
fi
More information about the Pkg-openldap-devel
mailing list