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.)
{
int success = 0, tries = 0;
{
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);
if (tries++)
sleep(5*60);
com_err(whoami, 0, "Executing command: %s", cmd);
char *user;
{
if (atoi(av[5])) {
char *user;
{
if (atoi(av[5])) {
- sleep(1); /* give the ptserver room */
edit_group(1, av[0], "USER", user);
}
}
edit_group(1, av[0], "USER", user);
}
}
if (astate == bstate) {
/* Only a modify has to be done */
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",
if (code) {
critical_alert("incremental",
"Couldn't change user %s (id %d) to %s (id %d): %s",
"Couldn't create user %s (id %d): %s",
after[U_NAME], auid, error_message(code));
}
"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));
if (beforec) {
/* Reactivating a user; get his group list */
gethostname(hostname, sizeof(hostname));
after[U_NAME], error_message(code));
return;
}
after[U_NAME], error_message(code));
return;
}
av[1] = after[U_NAME];
code = mr_query("get_lists_of_member", 2, av,
add_user_lists, after[U_NAME]);
av[1] = after[U_NAME];
code = mr_query("get_lists_of_member", 2, av,
add_user_lists, after[U_NAME]);
+ 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;
/* We need to make sure the group is properly populated */
if (beforec < L_ACTIVE || atoi(before[L_ACTIVE]) == 0) return;
int code=0;
if (strcmp(av[0], "LIST")) {
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],
edit_group(1, group, av[0], av[1]);
} else {
code = mr_query("get_end_members_of_list", 1, &av[1],
strcpy(buf, "system:");
strcat(buf, group);
strcpy(buf, "system:");
strcat(buf, group);
+ sleep(1); /* give ptserver some time */
code = (*fn)(member, buf);
if (code) {
if (op==0 && code == PRNOENT) return;
code = (*fn)(member, buf);
if (code) {
if (op==0 && code == PRNOENT) return;