mirror of
https://git.openldap.org/openldap/openldap.git
synced 2026-01-03 05:30:07 -05:00
Sync replication config option format change (interval)
This commit is contained in:
parent
9760933c20
commit
5548a2dd0c
5 changed files with 34 additions and 13 deletions
|
|
@ -3001,10 +3001,31 @@ parse_syncrepl_line(
|
|||
} else if ( !strncasecmp( cargv[ i ],
|
||||
INTERVALSTR, sizeof( INTERVALSTR ) - 1 ) ) {
|
||||
val = cargv[ i ] + sizeof( INTERVALSTR );
|
||||
if ( si->type == LDAP_SYNC_REFRESH_AND_PERSIST )
|
||||
if ( si->type == LDAP_SYNC_REFRESH_AND_PERSIST ) {
|
||||
si->interval = 0;
|
||||
else
|
||||
si->interval = atoi( val );
|
||||
} else {
|
||||
char *dstr;
|
||||
char *hstr;
|
||||
char *mstr;
|
||||
dstr = val;
|
||||
hstr = strchr( dstr, ':' );
|
||||
if ( hstr == NULL ) {
|
||||
fprintf( stderr, "Error: parse_syncrepl_line: "
|
||||
"invalid interval \"%s\"\n", val );
|
||||
return 1;
|
||||
}
|
||||
*hstr++ = '\0';
|
||||
mstr = strchr( hstr, ':' );
|
||||
if ( mstr == NULL ) {
|
||||
fprintf( stderr, "Error: parse_syncrepl_line: "
|
||||
"invalid interval \"%s\"\n", val );
|
||||
return 1;
|
||||
}
|
||||
*mstr++ = '\0';
|
||||
si->interval = (( atoi( dstr ) * 24 + atoi( hstr )) * 60
|
||||
+ atoi( mstr )) * 60;
|
||||
fprintf(stderr, "interval = %d\n", si->interval );
|
||||
}
|
||||
if ( si->interval < 0 ) {
|
||||
fprintf( stderr, "Error: parse_syncrepl_line: "
|
||||
"invalid interval \"%ld\"\n",
|
||||
|
|
|
|||
|
|
@ -42,4 +42,4 @@ syncrepl id=1
|
|||
lastmod=req
|
||||
scope=sub
|
||||
type=refreshOnly
|
||||
interval=10
|
||||
interval=00:00:01
|
||||
|
|
|
|||
|
|
@ -42,4 +42,4 @@ syncrepl id=1
|
|||
lastmod=req
|
||||
scope=sub
|
||||
type=refreshOnly
|
||||
interval=10
|
||||
interval=00:00:01
|
||||
|
|
|
|||
|
|
@ -94,8 +94,8 @@ if test $RC != 0 ; then
|
|||
exit $RC
|
||||
fi
|
||||
|
||||
echo "Waiting 30 seconds for syncrepl to receive changes..."
|
||||
sleep 30
|
||||
echo "Waiting 90 seconds for syncrepl to receive changes..."
|
||||
sleep 90
|
||||
|
||||
echo "Using ldapmodify to modify master directory..."
|
||||
|
||||
|
|
@ -176,8 +176,8 @@ changetype: delete
|
|||
|
||||
EOMODS
|
||||
|
||||
echo "Waiting 30 seconds for syncrepl to receive changes..."
|
||||
sleep 30
|
||||
echo "Waiting 90 seconds for syncrepl to receive changes..."
|
||||
sleep 90
|
||||
|
||||
echo "Using ldapsearch to read all the entries from the master..."
|
||||
$LDAPSEARCH -S "" -b "$BASEDN" -h $LOCALHOST -p $PORT \
|
||||
|
|
|
|||
|
|
@ -205,8 +205,8 @@ if test $RC != 0 ; then
|
|||
exit $RC
|
||||
fi
|
||||
|
||||
echo "Waiting 60 seconds for syncrepl to receive changes..."
|
||||
sleep 60
|
||||
echo "Waiting 90 seconds for syncrepl to receive changes..."
|
||||
sleep 90
|
||||
|
||||
echo "Using ldapmodify to modify master directory..."
|
||||
|
||||
|
|
@ -287,8 +287,8 @@ changetype: delete
|
|||
|
||||
EOMODS
|
||||
|
||||
echo "Waiting 60 seconds for syncrepl to receive changes..."
|
||||
sleep 60
|
||||
echo "Waiting 90 seconds for syncrepl to receive changes..."
|
||||
sleep 90
|
||||
|
||||
echo "Using ldapsearch to read all the entries from the master..."
|
||||
$LDAPSEARCH -S "" -b "$BASEDN" -h $LOCALHOST -p $PORT \
|
||||
|
|
|
|||
Loading…
Reference in a new issue