Remove configure-slapd.sh add reset-slapd.sh which is more stateless
This commit is contained in:
parent
08987cfce0
commit
da504db847
|
@ -1,12 +0,0 @@
|
|||
#!/bin/sh
|
||||
# Do initial configuration of slapd
|
||||
|
||||
BASEDIR=`dirname $0`
|
||||
|
||||
echo Load overlay modules, configure auditlog for cn=config, create cn=monitor db
|
||||
ldapvi --profile config --ldapvi --add --ldapmodify "$BASEDIR/configure-slapd.ldif"
|
||||
|
||||
echo Load supann and eduperson schema
|
||||
ldapvi --profile config --ldapvi --add --ldapmodify "$BASEDIR/supann-2009.ldif"
|
||||
ldapvi --profile config --ldapvi --add --ldapmodify "$BASEDIR/eduperson.ldif"
|
||||
ldapvi --profile config --ldapvi --add --ldapmodify "$BASEDIR/eduorg-200210-openldap.ldif"
|
|
@ -1,4 +1,4 @@
|
|||
add cn=eduorg-200210,cn=schema,cn=config
|
||||
dn: cn=eduorg-200210,cn=schema,cn=config
|
||||
objectClass: olcSchemaConfig
|
||||
cn: eduorg-200210
|
||||
olcAttributeTypes: {0}( 1.3.6.1.4.1.5923.1.2.1.2 NAME 'eduOrgHomePageURI' DESC
|
||||
|
|
|
@ -3,7 +3,7 @@
|
|||
# Put this file to /etc/ldap/schema/ and then execute the following
|
||||
# comand to add this schema:
|
||||
# ldapadd -Y EXTERNAL -H ldapi:/// -f /etc/ldap/schema/eduperson.ldif
|
||||
add: cn=eduperson,cn=schema,cn=config
|
||||
dn: cn=eduperson,cn=schema,cn=config
|
||||
objectClass: olcSchemaConfig
|
||||
cn: eduperson
|
||||
olcAttributeTypes: {0}( 1.3.6.1.4.1.5923.1.1.1.1 NAME 'eduPersonAffiliation' D
|
||||
|
|
|
@ -0,0 +1,27 @@
|
|||
#!/bin/sh
|
||||
# Do initial configuration of slapd
|
||||
|
||||
set -e
|
||||
|
||||
BASEDIR=`dirname $0`
|
||||
|
||||
service slapd stop || true
|
||||
BACKUPDIR="/var/backup/reset-ldap-`date +%Y%m%dT%H:%M:%S`"
|
||||
mkdir -p "$BACKUPDIR"
|
||||
echo Old configuration saved in $BACKUPDIR
|
||||
cp -R /var/lib/ldap /etc/ldap/slapd.d/ "$BACKUPDIR"
|
||||
rm -rf /var/lib/ldap/* /etc/ldap/slapd.d/*
|
||||
mkdir /var/lib/ldap/config-accesslog/
|
||||
|
||||
echo Load overlay modules, configure auditlog for cn=config, create cn=monitor db
|
||||
slapadd -n0 -F/etc/ldap/slapd.d -l"$BASEDIR/config.ldif"
|
||||
slapadd -n0 -F/etc/ldap/slapd.d -l"/etc/ldap/schema/core.ldif"
|
||||
slapadd -n0 -F/etc/ldap/slapd.d -l"/etc/ldap/schema/cosine.ldif"
|
||||
slapadd -n0 -F/etc/ldap/slapd.d -l"/etc/ldap/schema/inetorgperson.ldif"
|
||||
slapadd -n0 -F/etc/ldap/slapd.d -l"$BASEDIR/supann-2009.ldif"
|
||||
slapadd -n0 -F/etc/ldap/slapd.d -l"$BASEDIR/eduperson.ldif"
|
||||
slapadd -n0 -F/etc/ldap/slapd.d -l"$BASEDIR/eduorg-200210-openldap.ldif"
|
||||
|
||||
chown -R openldap.openldap /etc/ldap/slapd.d /var/lib/ldap
|
||||
|
||||
service slapd start
|
|
@ -10,7 +10,7 @@
|
|||
#
|
||||
################################################################################
|
||||
#
|
||||
add cn=supann,cn=schema,cn=config
|
||||
dn: cn=supann,cn=schema,cn=config
|
||||
objectClass: olcSchemaConfig
|
||||
#
|
||||
################################################################################
|
||||
|
|
Reference in New Issue