From 05dc6ea44ee6747402d756fb61805f9d65513f98 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Jan=20=C5=A0afr=C3=A1nek?= Date: Tue, 18 Sep 2007 10:41:07 +0000 Subject: [PATCH] fixed upgrade with empty database fixed /etc/sysconfig/ldap handling --- ldap.init | 2 +- ldap.sysconfig | 10 ++++++---- openldap.spec | 5 +++-- 3 files changed, 10 insertions(+), 7 deletions(-) diff --git a/ldap.init b/ldap.init index 300f14d..d7f6311 100644 --- a/ldap.init +++ b/ldap.init @@ -154,7 +154,7 @@ function start() { user=ldap prog=`basename ${slapd}` harg="" - if test x$LDAPD_LDAP = xyes ; then + if test x$SLAPD_LDAP = xyes ; then harg="ldap:///" fi if test x$SLAPD_LDAPS = xyes ; then diff --git a/ldap.sysconfig b/ldap.sysconfig index 6e3a86b..4e45769 100644 --- a/ldap.sysconfig +++ b/ldap.sysconfig @@ -1,18 +1,20 @@ -# options of slapd (see man slapd) +# Options of slapd (see man slapd) #SLAPD_OPTIONS= # options of slurpd (see man slurpd) # #SLURPD_OPTIONS= -# run slapd with -h "... ldap:/// ..." +# At least one of SLAPD_LDAP, SLAPD_LDAPI and SLAPD_LDAPS must be set to 'yes'! +# +# Run slapd with -h "... ldap:/// ..." # yes/no, default: yes #SLAPD_LDAP=yes -# run slapd with -h "... ldapi:/// ..." +# Run slapd with -h "... ldapi:/// ..." # yes/no, default: no #SLAPD_LDAPI=no -# run slapd with -h "... ldaps:/// ..." +# Run slapd with -h "... ldaps:/// ..." # yes/no, default: no #SLAPD_LDAPS=no diff --git a/openldap.spec b/openldap.spec index 1af5457..3f7aee8 100644 --- a/openldap.spec +++ b/openldap.spec @@ -513,7 +513,7 @@ fi files=$(echo /var/lib/ldap/{log.*,__db.*,[a]lock}) if [ "$files" != '/var/lib/ldap/log.* /var/lib/ldap/__db.* /var/lib/ldap/[a]lock' ] ; then if /usr/sbin/slapcat -l /var/lib/ldap/upgrade.ldif > /dev/null 2>&1 ; then - if [ -s /var/lib/ldap/upgrade.ldif ] ; then + if [ -f /var/lib/ldap/upgrade.ldif ] ; then /bin/rm -fr /var/lib/ldap/rpmorig > /dev/null 2>&1 || : mkdir /var/lib/ldap/rpmorig mv /var/lib/ldap/{alock,*.bdb,__db.*,log.*} /var/lib/ldap/rpmorig > /dev/null 2>&1 || : @@ -529,7 +529,7 @@ fi /sbin/chkconfig --add ldap # If there's a /var/lib/ldap/upgrade.ldif file, slapadd it and delete it. # It was created by the uninstall of the previous version. -if [ -s /var/lib/ldap/upgrade.ldif ] ; then +if [ -f /var/lib/ldap/upgrade.ldif ] ; then /sbin/runuser -m -s /usr/sbin/slapadd -- "ldap" -l /var/lib/ldap/upgrade.ldif > /dev/null 2>&1 rm /var/lib/ldap/upgrade.ldif fi @@ -680,6 +680,7 @@ fi - skeleton /etc/sysconfig/ldap added - new SLAPD_LDAP option to turn off listening on ldap:/// (#292591) - fixed checking of SSL (#292611) +- fixed upgrade with empty database * Thu Sep 6 2007 Jan Safranek 2.3.38-1%{?dist} - new upstream version