ALT Linux repositórios
Group :: Sistema/Servidores
RPM: openldap
Main Changelog Spec Patches Sources Download Gear Bugs e FR Repocop
#!/bin/sh -e
# Source functions library
. /etc/chroot.d/functions
cd /var/lib/ldap
force=
if [ "$1" = "force" ]; then
force=-f
shift
rm -f etc/schema/*
fi
# Usual configs
for f in `cd /etc/openldap; ls slapd*.conf` rootdse.ldif; do
Copy -m640 -oldap -gldap $force "/etc/openldap/$f" "etc/$f" || continue
done
#for f in `ls /etc/openldap/schema/`; do
# Copy -m644 $force "/etc/openldap/schema/$f" "etc/schema/$f"
#done
#This is temp! Only for temp
cd /etc/openldap
tar -pPc schema | tar -xp -C /var/lib/ldap/etc/
cd /var/lib/ldap
# Wee need to think about this!
for f in `ls /etc/openldap/ssl/`; do
Copy -m644 $force "/etc/openldap/ssl/$f" "etc/ssl/$f"
done
grep ldap /etc/group > etc/group
grep ldap /etc/passwd > etc/passwd
# create direcrory for each configured LDAP database
awk '/^directory/ {sub(/\//,"",$2);print $2}' /etc/openldap/*slapd*.conf \
| xargs install -d -o ldap -g ldap -m 0700
# install and adjust default BDB config file
for d in `awk '/^directory/ {sub(/\//,"",$2);print $2}' /etc/openldap/*slapd*.conf`; do
if [ ! -f $d/DB_CONFIG ]; then
install -o root -g ldap -m 0644 bases/DB_CONFIG $d/DB_CONFIG
LG_DIR=`basename $d`
subst "s|#set_lg_dir /var/lib/ldap/dblogs|set_lg_dir /var/lib/ldap/dblogs/$LG_DIR|" $d/DB_CONFIG
fi
done
# create transactions log directory for each configured LDAP database
awk '/^directory/ {sub(/\//,"",$2);print $2}' /etc/openldap/*slapd*.conf | sed 's|ldap/bases|ldap/dblogs|' \
| xargs install -d -o ldap -g ldap -m 0700
copy_resolv_conf