#ifndef AFS_NT40_ENV
int DoSyslogFacility = LOG_DAEMON;
#endif
+int DoTransarcLogs = 0;
static afs_int32 nextRestart;
static afs_int32 nextDay;
afs_int32 numClasses;
int DoPeerRPCStats = 0;
int DoProcessRPCStats = 0;
+ struct stat sb;
#ifndef AFS_NT40_ENV
int nofork = 0;
- struct stat sb;
#endif
#ifdef AFS_AIX32_ENV
struct sigaction nsa;
DoPidFiles = (argv[code]+10);
} else if (strncmp(argv[code], "-pidfiles", 9) == 0) {
DoPidFiles = AFSDIR_LOCAL_DIR;
+ } else if (strcmp(argv[code], "-transarc-logs") == 0) {
+ DoTransarcLogs = 1;
}
else {
/* hack to support help flag */
+ int ec;
+ if (strcmp(argv[code], "-help") == 0 || strcmp(argv[code], "-h") == 0)
+ ec = 0; /* It is not an error to ask for usage. */
+ else {
+ printf("Unrecognized option: %s\n", argv[code]);
+ ec = 1;
+ }
#ifndef AFS_NT40_ENV
printf("Usage: bosserver [-noauth] [-log] "
"[-enable_peer_stats] [-enable_process_stats] "
"[-cores=<none|path>] \n"
"[-pidfiles[=path]] "
+ "[-transarc-logs] "
"[-nofork] " "[-help]\n");
#else
printf("Usage: bosserver [-noauth] [-log] "
#endif
fflush(stdout);
- exit(0);
+ exit(ec);
}
}
if (auditFileName) {
exit(1);
}
- if ((!DoSyslog)
-#ifndef AFS_NT40_ENV
- && ((lstat(AFSDIR_SERVER_BOZLOG_FILEPATH, &sb) == 0) &&
- !(S_ISFIFO(sb.st_mode)))
-#endif
- ) {
- if (asprintf(&oldlog, "%s.old", AFSDIR_SERVER_BOZLOG_FILEPATH) < 0) {
- printf("bosserver: out of memory\n");
- exit(1);
+ if (!DoSyslog) {
+ /* Support logging to named pipes by not renaming. */
+ if (DoTransarcLogs
+ && (lstat(AFSDIR_SERVER_BOZLOG_FILEPATH, &sb) == 0)
+ && !(S_ISFIFO(sb.st_mode))) {
+ if (asprintf(&oldlog, "%s.old", AFSDIR_SERVER_BOZLOG_FILEPATH) < 0) {
+ printf("bosserver: out of memory\n");
+ exit(1);
+ }
+ rk_rename(AFSDIR_SERVER_BOZLOG_FILEPATH, oldlog);
+ free(oldlog);
}
- rk_rename(AFSDIR_SERVER_BOZLOG_FILEPATH, oldlog); /* try rename first */
- free(oldlog);
bozo_logFile = fopen(AFSDIR_SERVER_BOZLOG_FILEPATH, "a");
if (!bozo_logFile) {
printf("bosserver: can't initialize log file (%s).\n",