Masato Taruishi
taru****@users*****
2004年 10月 20日 (水) 22:25:32 JST
=================================================================== RCS file: ultrapossum/module/server/10server,v retrieving revision 1.25 retrieving revision 1.26 diff -u -r1.25 -r1.26 --- ultrapossum/module/server/10server 2004/10/14 09:50:46 1.25 +++ ultrapossum/module/server/10server 2004/10/20 13:25:31 1.26 @@ -119,10 +119,17 @@ SLAPD_MAJOR_VERSION=`ultrapossum_getconf SLAPD_MAJOR_VERSION 2.0` SLAPD_BERKLEYDB_SONAME=$(ultrapossum_getconf SLAPD_BERKLEYDB_SONAME `ldd $SLAPD 2> /dev/null | grep libdb | awk -F' ' '{print $1;}'`) +# slurpd variables SLURPDSLAVES=`ultrapossum_getconf SLURPDSLAVES ""` REPLICALISTENPORT=`ultrapossum_getconf REPLICALISTENPORT ldap` REPLICASTARTTLS=`ultrapossum_getconf REPLICASTARTTLS ""` +# syncrepl variables +SYNCREPLS=`ultrapossum_getconf SYNCREPLS ""` +SYNCREPLRID=`ultrapossum_getconf SYNCREPLRID "0"` +SYNCREPLTYPE=`ultrapossum_getconf SYNCREPLTYPE "refreshAndPersist"` +SYNCREPLINTERVAL=`ultrapossum_getconf SYNCREPLINTERVAL "00:01:00:00"` + # syncbackup variables SLAPD_PROVIDES_SYNCBACKUP=`ultrapossum_getconf SLAPD_PROVIDES_SYNCBACKUP ""` SYNCBACKUPS=`ultrapossum_getconf SYNCBACKUPS ""` @@ -187,6 +194,9 @@ if test "x$SLURPDSLAVES" != "x"; then SLAVES="$SLURPDSLAVES $SLAVES" +fi +if test "x$SYNCREPLS" != "x"; then + SLAVES="$SYNCREPLS $SLAVES" fi if test "x$SYNCBACKUPS" != "x"; then for s in $SYNCBACKUPS; do =================================================================== RCS file: ultrapossum/module/server/createdb.sh,v retrieving revision 1.29 retrieving revision 1.30 diff -u -r1.29 -r1.30 --- ultrapossum/module/server/createdb.sh 2004/10/17 04:03:09 1.29 +++ ultrapossum/module/server/createdb.sh 2004/10/20 13:25:31 1.30 @@ -48,6 +48,10 @@ exit 0 fi +if include "$HOST" "$SYNCREPLS"; then + exit 0 +fi + format=ldif if test "x$2" != "x"; then format=$2 =================================================================== RCS file: ultrapossum/module/server/server.cf,v retrieving revision 1.14 retrieving revision 1.15 diff -u -r1.14 -r1.15 --- ultrapossum/module/server/server.cf 2004/10/10 12:05:45 1.14 +++ ultrapossum/module/server/server.cf 2004/10/20 13:25:31 1.15 @@ -76,6 +76,7 @@ ### ### Slurpd style replica configuration +### # List of replica servers by slurpd #SLURPDSLAVES="" @@ -85,6 +86,19 @@ # debug level of slurpd #SLURPD_DEBUGLEVEL="0" + +### +### syncrepl style replica configuration +### + +# List of replica servers by syncrepl +#SYNCREPLS="" + +# LDAP Content Synchronization Protocol type to use +#SYNCREPLTYPE="refreshAndPersist|refreshOnly" + +# Refresh interval for refreshOnly type +#SYNCREPLINTERVAL="00:01:00:00" ### ### SyncBackup configuration (needs syncbackup patch) =================================================================== RCS file: ultrapossum/module/server/slapd.sh,v retrieving revision 1.14 retrieving revision 1.15 diff -u -r1.14 -r1.15 --- ultrapossum/module/server/slapd.sh 2004/10/14 01:57:20 1.14 +++ ultrapossum/module/server/slapd.sh 2004/10/20 13:25:31 1.15 @@ -154,6 +154,30 @@ echo "updateref $UPDATEREF" fi fi + if include "$HOST" "$SYNCREPLS"; then + echo "syncrepl rid=$SYNCREPLRID" + echo " provider=$UPDATEREF" + echo " type=$SYNCREPLTYPE" + if test "x$SYNCREPLTYPE" = "xrefreshOnly"; then + echo " interval=$SYNCREPLINTERVAL" + fi + echo " searchbase=$SUFFIX" + echo " updatedn=$UPDATEDN" + case "x$APPDNMODE" in + xSASL/Digest-MD5) + authcid="`echo $UPDATEDN | cut -d, -f1 | cut -d= -f2`@$PACKAGE" + echo " authcid=\"$authcid\"" + echo " bindmethod=sasl" + echo " saslmech=DIGEST-MD5" + echo " credentials=$CREDENTIALS" + ;; + x*) + echo " binddn=\"$UPDATEDN\"" + echo " bindmethod=simple" + echo " credentials=$CREDENTIALS" + ;; + esac + fi if include "$HOST" "$SYNCBACKUPS"; then echo "syncbackup syncid=$HOST" echo " provider=$UPDATEREF" =================================================================== RCS file: ultrapossum/module/server/update-server,v retrieving revision 1.55 retrieving revision 1.56 diff -u -r1.55 -r1.56 --- ultrapossum/module/server/update-server 2004/09/30 07:00:43 1.55 +++ ultrapossum/module/server/update-server 2004/10/20 13:25:31 1.56 @@ -241,6 +241,11 @@ echo "E: can't detect slapd supports syncbackup." 1>&2 exit 1 fi + if test "x$SYNCREPLS" != "x" && test "x$SLAPD_MAJOR_VERSION" != "x2.2" + then + echo "E: slapd doesn't support syncrepl." 1>&2 + exit 1 + fi if test "x$CHROOTDIRECTORY" != "x"; then egrep "^directory" $SLAPDCONF | awk -F' ' '{print $2;}' | while read d do