From: Derrick Brashear Date: Wed, 27 Apr 2005 02:37:04 +0000 (+0000) Subject: STABLE14-daemonize-log-somewhere-so-fds-can-close-without-harm-20050426 X-Git-Tag: openafs-devel-1_3_82~14 X-Git-Url: https://git.michaelhowe.org/gitweb/?a=commitdiff_plain;h=3b5e10271f28926cff7df9fa5a04768da5cc86e4;p=packages%2Fo%2Fopenafs.git STABLE14-daemonize-log-somewhere-so-fds-can-close-without-harm-20050426 FIXES 18405 switch to VLog from printf (cherry picked from commit e911b292af2c35f8f4af29aed26c557bf856d498) --- diff --git a/src/bozo/bosserver.c b/src/bozo/bosserver.c index 15f3343c6..9fab1c0e9 100644 --- a/src/bozo/bosserver.c +++ b/src/bozo/bosserver.c @@ -865,7 +865,7 @@ main(int argc, char **argv, char **envp) #ifndef AFS_NT40_ENV if (!nofork) - daemon(0, 0); + daemon(1, 0); #endif /* ! AFS_NT40_ENV */ if ((!DoSyslog) diff --git a/src/vlserver/vlprocs.c b/src/vlserver/vlprocs.c index b2b8fc74f..9d2feeaa5 100644 --- a/src/vlserver/vlprocs.c +++ b/src/vlserver/vlprocs.c @@ -1952,7 +1952,7 @@ SVL_GetAddrs(rxcall, Handle, spare2, spare3, nentries, addrsp) return (ubik_EndTrans(trans)); } -#define PADDR(addr) printf("%d.%d.%d.%d", (addr>>24)&0xff, (addr>>16)&0xff, (addr>>8) &0xff, addr&0xff); +#define PADDR(addr) VLog(0,("%d.%d.%d.%d", (addr>>24)&0xff, (addr>>16)&0xff, (addr>>8) &0xff, addr&0xff)); afs_int32 SVL_RegisterAddrs(rxcall, uuidp, spare1, addrsp) @@ -2087,18 +2087,18 @@ SVL_RegisterAddrs(rxcall, uuidp, spare1, addrsp) || (!foundUuidEntry && (count > 1))) { VLog(0, ("The following fileserver is being registered in the VLDB:\n")); - printf(" ["); + VLog(0, (" [")); for (k = 0; k < cnt; k++) { if (k > 0) - printf(" "); + VLog(0,(" ")); PADDR(addrs[k]); } - printf("]\n"); + VLog(0,("]\n")); if (foundUuidEntry) { - printf - (" It would have replaced the existing VLDB server entry:\n"); - printf(" entry %d: [", FoundUuid); + VLog(0, + (" It would have replaced the existing VLDB server entry:\n")); + VLog(0, (" entry %d: [", FoundUuid)); base = (HostAddress[FoundUuid] >> 16) & 0xff; index = HostAddress[FoundUuid] & 0x0000ffff; exp = &ex_addr[base][index]; @@ -2106,21 +2106,21 @@ SVL_RegisterAddrs(rxcall, uuidp, spare1, addrsp) if (!exp->ex_addrs[mhidx]) continue; if (mhidx > 0) - printf(" "); + VLog(0,(" ")); PADDR(ntohl(exp->ex_addrs[mhidx])); } - printf("]\n"); + VLog(0, ("]\n")); } if (count == 1) - printf(" Yet another VLDB server entry exists:\n"); + VLog(0, (" Yet another VLDB server entry exists:\n")); else - printf(" Yet other VLDB server entries exist:\n"); + VLog(0, (" Yet other VLDB server entries exist:\n")); for (j = 0; j < count; j++) { srvidx = WillChange[j]; - printf(" entry %d: ", srvidx); + VLog(0, (" entry %d: ", srvidx)); if ((HostAddress[srvidx] & 0xff000000) == 0xff000000) { - printf("["); + VLog(0, ("[")); base = (HostAddress[srvidx] >> 16) & 0xff; index = HostAddress[srvidx] & 0x0000ffff; exp = &ex_addr[base][index]; @@ -2128,25 +2128,25 @@ SVL_RegisterAddrs(rxcall, uuidp, spare1, addrsp) if (!exp->ex_addrs[mhidx]) continue; if (mhidx > 0) - printf(" "); + VLog(0, (" ")); PADDR(ntohl(exp->ex_addrs[mhidx])); } - printf("]"); + VLog(0, ("]")); } else { PADDR(HostAddress[srvidx]); } - printf("\n"); + VLog(0, ("\n")); } if (count == 1) - printf(" You must 'vos changeaddr' this other server entry\n"); + VLog(0, (" You must 'vos changeaddr' this other server entry\n")); else - printf - (" You must 'vos changeaddr' these other server entries\n"); + VLog(0, + (" You must 'vos changeaddr' these other server entries\n")); if (foundUuidEntry) - printf - (" and/or remove the sysid file from the registering fileserver\n"); - printf(" before the fileserver can be registered in the VLDB.\n"); + VLog(0, + (" and/or remove the sysid file from the registering fileserver\n")); + VLog(0, (" before the fileserver can be registered in the VLDB.\n")); ubik_AbortTrans(trans); return VL_MULTIPADDR; @@ -2178,26 +2178,26 @@ SVL_RegisterAddrs(rxcall, uuidp, spare1, addrsp) } VLog(0, ("The following fileserver is being registered in the VLDB:\n")); - printf(" ["); + VLog(0, (" [")); for (k = 0; k < cnt; k++) { if (k > 0) - printf(" "); + VLog(0, (" ")); PADDR(addrs[k]); } - printf("]\n"); + VLog(0, ("]\n")); if (foundUuidEntry) { - printf - (" It will replace the following existing entry in the VLDB (same uuid):\n"); - printf(" entry %d: [", FoundUuid); + VLog(0, + (" It will replace the following existing entry in the VLDB (same uuid):\n")); + VLog(0, (" entry %d: [", FoundUuid)); for (k = 0; k < VL_MAXIPADDRS_PERMH; k++) { if (exp->ex_addrs[k] == 0) continue; if (k > 0) - printf(" "); + VLog(0, (" ")); PADDR(ntohl(exp->ex_addrs[k])); } - printf("]\n"); + VLog(0, ("]\n")); } else if (willReplaceCnt || (count == 1)) { /* If we are not replacing an entry and there is only one entry to change, * then we will replace that entry. @@ -2213,24 +2213,24 @@ SVL_RegisterAddrs(rxcall, uuidp, spare1, addrsp) index = HostAddress[ReplaceEntry] & 0x0000ffff; exp = &ex_addr[fbase][index]; - printf - (" It will replace the following existing entry in the VLDB (new uuid):\n"); - printf(" entry %d: [", ReplaceEntry); + VLog(0, + (" It will replace the following existing entry in the VLDB (new uuid):\n")); + VLog(0, (" entry %d: [", ReplaceEntry)); for (k = 0; k < VL_MAXIPADDRS_PERMH; k++) { if (exp->ex_addrs[k] == 0) continue; if (k > 0) - printf(" "); + VLog(0, (" ")); PADDR(ntohl(exp->ex_addrs[k])); } - printf("]\n"); + VLog(0, ("]\n")); } else { /* Not a mh entry. So we have to create a new mh entry and * put it on the ReplaceEntry slot of the HostAddress array. */ - printf(" It will replace existing entry %d, ", ReplaceEntry); + VLog(0, (" It will replace existing entry %d, ", ReplaceEntry)); PADDR(HostAddress[ReplaceEntry]); - printf(", in the VLDB (new uuid):\n"); + VLog(0,(", in the VLDB (new uuid):\n")); code = FindExtentBlock(trans, uuidp, 1, ReplaceEntry, &exp, &fbase); @@ -2243,7 +2243,7 @@ SVL_RegisterAddrs(rxcall, uuidp, spare1, addrsp) /* There is no entry for this server, must create a new mh entry as * well as use a new slot of the HostAddress array. */ - printf(" It will create a new entry in the VLDB.\n"); + VLog(0, (" It will create a new entry in the VLDB.\n")); code = FindExtentBlock(trans, uuidp, 1, -1, &exp, &fbase); if (code || !exp) { ubik_AbortTrans(trans); @@ -2291,10 +2291,10 @@ SVL_RegisterAddrs(rxcall, uuidp, spare1, addrsp) tex = &ex_addr[fbase][index]; if (++m == 1) - printf - (" The following existing entries in the VLDB will be updated:\n"); + VLog(0, + (" The following existing entries in the VLDB will be updated:\n")); - printf(" entry %d: [", WillChange[i]); + VLog(0, (" entry %d: [", WillChange[i])); for (h = j = 0; j < VL_MAXIPADDRS_PERMH; j++) { if (tex->ex_addrs[j]) { if (j > 0) @@ -2315,7 +2315,7 @@ SVL_RegisterAddrs(rxcall, uuidp, spare1, addrsp) for (j = h; j < VL_MAXIPADDRS_PERMH; j++) { tex->ex_addrs[j] = 0; /* zero rest of mh entry */ } - printf("]\n"); + VLog(0, ("]\n")); /* Write out the modified mh entry */ tex->ex_uniquifier = htonl(ntohl(tex->ex_uniquifier) + 1); @@ -3212,25 +3212,25 @@ ChangeIPAddr(ipaddr1, ipaddr2, atrans) VLog(0, ("The following IP address is being %s:\n", (ipaddr2 ? "changed" : "removed"))); - printf(" entry %d: ", i); + VLog(0, (" entry %d: ", i)); if (exp) { - printf("["); + VLog(0, ("[")); for (mhidx = 0; mhidx < VL_MAXIPADDRS_PERMH; mhidx++) { if (!exp->ex_addrs[mhidx]) continue; if (mhidx > 0) - printf(" "); + VLog(0, (" ")); PADDR(ntohl(exp->ex_addrs[mhidx])); } - printf("]"); + VLog(0, ("]")); } else { PADDR(ipaddr1); } if (ipaddr2) { - printf(" -> "); + VLog(0, (" -> ")); PADDR(ipaddr2); } - printf("\n"); + VLog(0, ("\n")); /* Change the registered uuuid addresses */ if (exp) { diff --git a/src/vol/fssync.c b/src/vol/fssync.c index a0ebab90d..154a4d249 100644 --- a/src/vol/fssync.c +++ b/src/vol/fssync.c @@ -169,18 +169,10 @@ FSYNC_clientInit(void) FS_sd = getport(&addr); if (connect(FS_sd, (struct sockaddr *)&addr, sizeof(addr)) >= 0) return 1; -#if defined(AFS_SGI_ENV) - /* down with worthless error messages! */ - if (!*timeout) { - perror("FSYNC_clientInit failed (after many retries)"); - break; - } -#else if (!*timeout) break; if (!(*timeout & 1)) - perror("FSYNC_clientInit temporary failure (will retry)"); -#endif + Log(0, ("FSYNC_clientInit temporary failure (will retry)")); FSYNC_clientFinis(); sleep(*timeout++); }