/* */
/* ********************************************************************** */
+#include <afsconfig.h>
#include <afs/param.h>
+
+RCSID("$Header$");
+
#include <stdio.h>
#include <stdlib.h>
#include <errno.h>
code = afsconf_GetKey(confDir, akvno, tkey.key);
if (code)
return code;
- bcopy(tkey.key, akey, sizeof(tkey.key));
+ memcpy(akey, tkey.key, sizeof(tkey.key));
return 0;
} /*get_key*/
}
#endif
confDir = afsconf_Open(AFSDIR_SERVER_ETC_DIRPATH);
+ if (!confDir) {
+ fprintf(stderr, "Unable to open config directory %s\n",
+ AFSDIR_SERVER_ETC_DIRPATH);
+ exit(-1);
+ }
NewParms(1);
rx_SetDestroyConnProc(tservice, (char (*)()) h_FreeConnection);
rx_SetMinProcs(tservice, 3);
rx_SetMaxProcs(tservice, lwps);
+ rx_SetCheckReach(tservice, 1);
tservice = rx_NewService(0, RX_STATS_SERVICE_ID, "rpcstats", sc, 4, RXSTATS_ExecuteRequest);
if (!tservice) {
ViceLog(0, ("Can't find address for FileServer '%s'\n", FS_HostName));
}
else {
- bcopy(he->h_addr, &FS_HostAddr_NBO, 4);
- FS_HostAddr_HBO = ntohl(FS_HostAddr_NBO);
- ViceLog(0,("FileServer %s has address 0x%x (0x%x in host byte order)\n",
- FS_HostName, FS_HostAddr_NBO, FS_HostAddr_HBO));
+ char hoststr[16];
+ memcpy(&FS_HostAddr_NBO, he->h_addr, 4);
+ afs_inet_ntoa_r(FS_HostAddr_NBO, hoststr);
+ FS_HostAddr_HBO = ntohl(FS_HostAddr_NBO);
+ ViceLog(0,("FileServer %s has address %s (0x%x or 0x%x in host byte order)\n",
+ FS_HostName, hoststr, FS_HostAddr_NBO, FS_HostAddr_HBO));
}
/* Install handler to catch the shutdown signal */
ViceLog(2, ("Set disk usage statistics\n"));
VSetDiskUsage();
if (FS_registered == 1) Do_VLRegisterRPC();
-#ifndef AFS_QUIETFS_ENV
if(printBanner && (++msg&1)) { /* Every 10 minutes */
time_t now = FT_ApproxTime();
if (console != NULL) {
+#ifndef AFS_QUIETFS_ENV
fprintf(console,"File server is running at %s\r",
afs_ctime(&now, tbuffer, sizeof(tbuffer)));
+#endif /* AFS_QUIETFS_ENV */
+ ViceLog(2, ("File server is running at %s\n",
+ afs_ctime(&now, tbuffer, sizeof(tbuffer))));
}
}
-#endif /* AFS_QUIETFS_ENV */
}
} /*FiveMinuteCheckLWP*/
/*
* Zero all xstat-related structures.
*/
- bzero((char *)(&afs_perfstats), sizeof(struct afs_PerfStats));
+ memset((char *)(&afs_perfstats), 0, sizeof(struct afs_PerfStats));
#if FS_STATS_DETAILED
- bzero((char *)(&afs_FullPerfStats), sizeof(struct fs_stats_FullPerfStats));
+ memset((char *)(&afs_FullPerfStats), 0, sizeof(struct fs_stats_FullPerfStats));
/*
* That's not enough. We have to set reasonable minima for
rx_PrintStats(debugFile);
fflush(debugFile);
}
-#ifndef AFS_QUIETFS_ENV
if (console != NULL) {
now = time(0);
- if (dopanic)
+ if (dopanic) {
+#ifndef AFS_QUIETFS_ENV
fprintf(console, "File server has terminated abnormally at %s\r",
afs_ctime(&now, tbuffer, sizeof(tbuffer)));
- else
+#endif
+ ViceLog(0, ("File server has terminated abnormally at %s\n",
+ afs_ctime(&now, tbuffer, sizeof(tbuffer))));
+ } else {
+#ifndef AFS_QUIETFS_ENV
fprintf(console, "File server has terminated normally at %s\r",
afs_ctime(&now, tbuffer, sizeof(tbuffer)));
- }
#endif
+ ViceLog(0, ("File server has terminated normally at %s\n",
+ afs_ctime(&now, tbuffer, sizeof(tbuffer))));
+ }
+ }
exit(0);
AFSDIR_SERVER_NETINFO_FILEPATH,
AFSDIR_SERVER_NETRESTRICT_FILEPATH);
if (code < 0) {
- ViceLog(0,("Can' register any valid addresses:%s\n",reason));
+ ViceLog(0,("Can't register any valid addresses: %s\n",reason));
exit(1);
}
FS_HostAddr_cnt = (afs_uint32) code;