C<always> option allows for an unacceptable risk of data loss. This may
depend on your usage patterns, your platform and filesystem, and who you talk
to about this topic.
+
+=item B<-logfile> <I<log file>>
+
+Sets the file to use for server logging. If logfile is not specified and
+no other logging options are supplied, this will be F</usr/afs/logs/FileLog>.
+Note that this option is intended for debugging and testing purposes.
+Changing the location of the log file from the command line may result
+in undesirable interactions with tools such as B<bos>.
+
+=item B<-config> <I<configuration directory>>
+
+Set the location of the configuration directory used to configure this
+service. In a typical configuration this will be F</usr/afs/etc> - this
+option allows the use of alternative configuration locations for testing
+purposes.
int eventlog = 0, rxlog = 0;
FILE *debugFile;
+char *logFile = NULL;
pthread_mutex_t fsync_glock_mutex;
pthread_cond_t fsync_cond;
cmd_AddParmAtOffset(opts, OPT_sync, "-sync",
CMD_SINGLE, CMD_OPTIONAL, "always | onclose | never");
+ /* testing options */
+ cmd_AddParmAtOffset(opts, OPT_logfile, "-logfile", CMD_SINGLE,
+ CMD_OPTIONAL, "location of log file");
+ cmd_AddParmAtOffset(opts, OPT_config, "-config", CMD_SINGLE,
+ CMD_OPTIONAL, "configuration location");
+
code = cmd_Parse(argc, argv, &opts);
if (code)
return -1;
- /* XXX - cmd_OptionAsString(opts, OPT_config, &configDir); */
-
cmd_OpenConfigFile(AFSDIR_SERVER_CONFIG_FILE_FILEPATH);
cmd_SetCommandName("fileserver");
}
cmd_OptionAsInt(opts, OPT_debug, &LogLevel);
- /* XXX - cmd_OptionAsString(opts, OPT_logfile, &logFile); */
cmd_OptionAsFlag(opts, OPT_mrafslogs, &mrafsStyleLogs);
if (cmd_OptionAsInt(opts, OPT_threads, &lwps) == 0) {
busy_threshold = 3 * rxpackets / 2;
}
+ cmd_OptionAsString(opts, OPT_logfile, &logFile);
+ cmd_OptionAsString(opts, OPT_config, &FS_configPath);
+
+
if (auditFileName)
osi_audit_file(auditFileName);
/* check for the parameter file */
CheckParms();
+ FS_configPath = strdup(AFSDIR_SERVER_ETC_DIRPATH);
+ logFile = strdup(AFSDIR_SERVER_FILELOG_FILEPATH);
+
if (ParseArgs(argc, argv)) {
exit(-1);
}
exit(1);
}
#endif
- FS_configPath = strdup(AFSDIR_SERVER_ETC_DIRPATH);
confDir = afsconf_Open(FS_configPath);
if (!confDir) {
#ifndef AFS_NT40_ENV
serverLogSyslogTag = "fileserver";
#endif
- OpenLog(AFSDIR_SERVER_FILELOG_FILEPATH);
+ OpenLog(logFile);
SetupLogSignals();
LogCommandLine(argc, argv, "starting", "", "File server", FSLog);