#include <afs/pterror.h>
#define STOP_FILE "/moira/afs/noafs"
-#define TRY_PR 2
+#define PR_TRIES 2
+#define PR_DELAY 5
#define file_exists(file) (access((file), F_OK) == 0)
/* Only a modify has to be done */
tries = 0;
while (code=pr_ChangeEntry(before[U_NAME], after[U_NAME], auid, "")) {
- if (++tries > TRY_PR)
+ if (++tries > PR_TRIES)
break;
if (code == UNOQUORUM) { sleep(90); continue; }
- sleep(2);
+ sleep(PR_DELAY);
}
if (code) {
critical_alert("incremental",
if (bstate == 1) {
tries = 0;
while (code = pr_DeleteByID(buid)) {
- if (++tries > TRY_PR)
+ if (++tries > PR_TRIES)
break;
if (code == UNOQUORUM) { sleep(90); continue; }
- sleep(2);
+ sleep(PR_DELAY);
}
if (code && code != PRNOENT) {
critical_alert("incremental",
if (astate == 1) {
tries = 0;
while (code = pr_CreateUser(after[U_NAME], &auid)) {
- if (++tries > TRY_PR)
+ if (++tries > PR_TRIES)
break;
if (code == UNOQUORUM) { sleep(90); continue; }
- sleep(2);
+ sleep(PR_DELAY);
}
if (code) {
critical_alert("incremental",
strcat(g2, after[L_NAME]);
tries = 0;
while (code = pr_ChangeEntry(g1, g2, -agid, "")) {
- if (++tries > TRY_PR)
+ if (++tries > PR_TRIES)
break;
if (code == UNOQUORUM) { sleep(90); continue; }
- sleep(2);
+ sleep(PR_DELAY);
}
if (code) {
critical_alert("incremental",
(-agid, PR_SF_ALLBITS,
(ahide ?PRP_STATUS_ANY :PRP_GROUP_DEFAULT)>>PRIVATE_SHIFT,
0 /*ngroups*/, 0 /*nusers*/)) {
- if (++tries > TRY_PR)
+ if (++tries > PR_TRIES)
break;
if (code == UNOQUORUM) { sleep(90); continue; }
- sleep(2);
+ sleep(PR_DELAY);
}
if (code) {
critical_alert("incremental",
if (bgid) {
tries = 0;
while (code = pr_DeleteByID(-bgid)) {
- if (++tries > TRY_PR)
+ if (++tries > PR_TRIES)
break;
if (code == UNOQUORUM) { sleep(90); continue; }
- sleep(2);
+ sleep(PR_DELAY);
}
if (code && code != PRNOENT) {
critical_alert("incremental",
id = -agid;
tries = 0;
while (code = pr_CreateGroup(g1, g2, &id)) {
- if (++tries > TRY_PR)
+ if (++tries > PR_TRIES)
break;
if (code == UNOQUORUM) { sleep(90); continue; }
- sleep(2);
+ sleep(PR_DELAY);
}
if (code) {
critical_alert("incremental",
(-agid, PR_SF_ALLBITS,
(ahide ?PRP_STATUS_ANY :PRP_GROUP_DEFAULT)>>PRIVATE_SHIFT,
0 /*ngroups*/, 0 /*nusers*/)) {
- if (++tries > TRY_PR)
+ if (++tries > PR_TRIES)
break;
if (code == UNOQUORUM) { sleep(90); continue; }
- sleep(2);
+ sleep(PR_DELAY);
}
if (code) {
critical_alert("incremental",
strcat(buf, group);
sleep(1); /* give ptserver some time */
while (code = (*fn)(member, buf)) {
- if (++tries > TRY_PR)
+ if (++tries > PR_TRIES)
break;
if (code == UNOQUORUM) { sleep(90); continue; }
- sleep(2);
+ sleep(PR_DELAY);
}
if (code) {
if (op==0 && code == PRNOENT) return;