From: probe Date: Thu, 16 Jul 1992 22:11:23 +0000 (+0000) Subject: Since pr_ChangeEntry() already checks to see if the id's aren't changing, X-Git-Tag: release77~474 X-Git-Url: http://andersk.mit.edu/gitweb/moira.git/commitdiff_plain/2dbcb7568242fbc2942de7a53ea5d28af623236c Since pr_ChangeEntry() already checks to see if the id's aren't changing, don't bother conditionalizing the call. Added a few sleep() calls to give the ptserver some breathing room. (This may still need some tuning, or possibly retry attempts added.) If a script fails to run properly, retry it (it may have been due to some temporary failure such as loss of quorom, slow prdb ubik updates, etc.) --- diff --git a/incremental/afs.c b/incremental/afs.c index e1431e75..2c5e6230 100644 --- a/incremental/afs.c +++ b/incremental/afs.c @@ -96,7 +96,7 @@ char *cmd; { int success = 0, tries = 0; - while (success == 0 && tries < 1) { + while (success == 0 && tries < 2) { if (tries++) sleep(5*60); com_err(whoami, 0, "Executing command: %s", cmd); @@ -114,7 +114,6 @@ add_user_lists(ac, av, user) char *user; { if (atoi(av[5])) { - sleep(1); /* give the ptserver room */ edit_group(1, av[0], "USER", user); } } @@ -157,8 +156,7 @@ int afterc; if (astate == bstate) { /* Only a modify has to be done */ - code = pr_ChangeEntry(before[U_NAME], after[U_NAME], - (auid==buid) ? 0 : auid, ""); + code = pr_ChangeEntry(before[U_NAME], after[U_NAME], auid, ""); if (code) { critical_alert("incremental", "Couldn't change user %s (id %d) to %s (id %d): %s", @@ -183,6 +181,8 @@ int afterc; "Couldn't create user %s (id %d): %s", after[U_NAME], auid, error_message(code)); } + sleep(1); /* give ptserver some time */ + if (beforec) { /* Reactivating a user; get his group list */ gethostname(hostname, sizeof(hostname)); @@ -194,7 +194,7 @@ int afterc; after[U_NAME], error_message(code)); return; } - av[0] = "RUSER"; + av[0] = "ruser"; av[1] = after[U_NAME]; code = mr_query("get_lists_of_member", 2, av, add_user_lists, after[U_NAME]); @@ -304,6 +304,8 @@ int afterc; } } + sleep(1); /* give ptserver some time */ + /* We need to make sure the group is properly populated */ if (beforec < L_ACTIVE || atoi(before[L_ACTIVE]) == 0) return; @@ -361,7 +363,6 @@ get_members(ac, av, group) int code=0; if (strcmp(av[0], "LIST")) { - sleep(1); /* give the ptserver room */ edit_group(1, group, av[0], av[1]); } else { code = mr_query("get_end_members_of_list", 1, &av[1], @@ -404,6 +405,7 @@ edit_group(op, group, type, member) strcpy(buf, "system:"); strcat(buf, group); + sleep(1); /* give ptserver some time */ code = (*fn)(member, buf); if (code) { if (op==0 && code == PRNOENT) return;