int debugging = 0;
int rxBind = 0;
+int lwps = 3;
+
+#define MINLWP 3
+#define MAXLWP 16
#define ADDRSPERSITE 16 /* Same global is in rx/rx_user.c */
afs_uint32 SHostAddrs[ADDRSPERSITE];
* initialize all the supported commands and their arguments
*/
+void
initializeArgHandler()
{
struct cmd_syndesc *cptr;
cmd_AddParm(cptr, "-auditlog", CMD_SINGLE, CMD_OPTIONAL,
"audit log path");
+ cmd_AddParm(cptr, "-p", CMD_SINGLE, CMD_OPTIONAL,
+ "number of processes");
+
+ cmd_AddParm(cptr, "-rxbind", CMD_FLAG, CMD_OPTIONAL,
+ "bind the Rx socket (primary interface only)");
+
}
int
ubik_nBuffers = 0;
if (as->parms[7].items != 0) {
- int tempfd, flags;
- FILE *auditout;
- char oldName[MAXPATHLEN];
char *fileName = as->parms[7].items->data;
-#ifndef AFS_NT40_ENV
- struct stat statbuf;
- if ((lstat(fileName, &statbuf) == 0)
- && (S_ISFIFO(statbuf.st_mode))) {
- flags = O_WRONLY | O_NONBLOCK;
- } else
-#endif
- {
- strcpy(oldName, fileName);
- strcat(oldName, ".old");
- renamefile(fileName, oldName);
- flags = O_WRONLY | O_TRUNC | O_CREAT;
+ osi_audit_file(fileName);
+ }
+
+ /* user provided the number of threads */
+ if (as->parms[8].items != 0) {
+ lwps = atoi(as->parms[8].items->data);
+ if (lwps > MAXLWP) {
+ printf ("Warning: '-p %d' is too big; using %d instead\n",
+ lwps, MAXLWP);
+ lwps = MAXLWP;
+ }
+ if (lwps < MINLWP) {
+ printf ("Warning: '-p %d' is too small; using %d instead\n",
+ lwps, MINLWP);
+ lwps = MINLWP;
}
- tempfd = open(fileName, flags, 0666);
- if (tempfd > -1) {
- auditout = fdopen(tempfd, "a");
- if (auditout) {
- osi_audit_file(auditout);
- } else
- printf("Warning: auditlog %s not writable, ignored.\n", fileName);
- } else
- printf("Warning: auditlog %s not writable, ignored.\n", fileName);
+ }
+
+ /* user provided rxbind option */
+ if (as->parms[9].items != 0) {
+ rxBind = 1;
}
return 0;
if (rxBind) {
afs_int32 ccode;
-#ifndef AFS_NT40_ENV
if (AFSDIR_SERVER_NETRESTRICT_FILEPATH ||
AFSDIR_SERVER_NETINFO_FILEPATH) {
char reason[1024];
AFSDIR_SERVER_NETINFO_FILEPATH,
AFSDIR_SERVER_NETRESTRICT_FILEPATH);
} else
-#endif
{
ccode = rx_getAllAddr(SHostAddrs, ADDRSPERSITE);
}
BUDB_EXIT(3);
}
rx_SetMinProcs(tservice, 1);
- rx_SetMaxProcs(tservice, 3);
+ rx_SetMaxProcs(tservice, lwps);
rx_SetStackSize(tservice, 10000);
/* allow super users to manage RX statistics */
currentTime = time(0);
LogError(0, "Ready to process requests at %s\n", ctime(¤tTime));
- rx_ServerProc(); /* donate this LWP */
+ rx_ServerProc(NULL); /* donate this LWP */
error_exit:
osi_audit(BUDB_FinishEvent, code, AUD_END);
return (code);
}
-
+void
consistencyCheckDb()
{
/* do consistency checks on structure sizes */
static char timestamp[20];
lt = localtime(&t);
- strftime(timestamp, 20, "%m/%d/%Y %T", lt);
+ strftime(timestamp, 20, "%m/%d/%Y %H:%M:%S", lt);
return timestamp;
}