=for html
<div class="synopsis">
-B<vlserver> S<<< [B<-p> <I<number of threads>>] >>> [B<-nojumbo>] [B<-jumbo>] [B<-rxbind>] S<<< [B<-d> <I<debug level>>] >>>
- [B<-allow-dotted-principals>] [B<-enable_peer_stats>] [B<-enable_process_stats>]
- S<<< [B<-auditlog> <I<log path>>] >>> [B<-audit-interface> (file | sysvmq)]
- [B<-help>]
+vlserver S<<< [B<-p> <I<number of threads>>] >>> [B<-nojumbo>]
+[B<-jumbo>] [B<-rxbind>] S<<< [B<-d> <I<debug level>>] >>>
+[B<-allow-dotted-principals>] S<<< [B<-database <I<database path>>] >>>
+S<<< [B<-logfile <I<log file>>] >>> S<<< [B<-config <I<configuration path>>] >>>
+[B<-enable_peer_stats>] [B<-enable_process_stats>]
+S<<< [B<-auditlog> <I<log path>>] >>> S<<< [B<-audit-interface> (file | sysvmq)] >>>
+[B<-help>]
=for html
</div>
Bind the Rx socket to the primary interface only. (If not specified, the
Rx socket will listen on all interfaces.)
+=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/VLLog>.
+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<-database <I<databse path>>
+
+Set the location of the database used by this program. This option is
+intended primarily for testing purposes.
+
+=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.
+
=item B<-help>
Prints the online help for this command. All other valid options are
#include "vlserver_internal.h"
#define MAXLWP 16
-const char *vl_dbaseName;
struct afsconf_dir *vldb_confdir = 0; /* vldb configuration dir */
int lwps = 9;
char *auditFileName = NULL;
afs_uint32 host = ntohl(INADDR_ANY);
+ const char *vl_dbaseName;
+ const char *configDir;
+ const char *logFile;
+
#ifdef AFS_AIX32_ENV
/*
* The following signal action for AIX is necessary so that in case of a
#endif
osi_audit_init();
+ /* Initialize dirpaths */
+ if (!(initAFSDirPath() & AFSDIR_SERVER_PATHS_OK)) {
+#ifdef AFS_NT40_ENV
+ ReportErrorEventAlt(AFSEVT_SVR_NO_INSTALL_DIR, 0, argv[0], 0);
+#endif
+ fprintf(stderr, "%s: Unable to obtain AFS server directory.\n",
+ argv[0]);
+ exit(2);
+ }
+
+ vl_dbaseName = AFSDIR_SERVER_VLDB_FILEPATH;
+ configDir = AFSDIR_SERVER_ETC_DIRPATH;
+ logFile = AFSDIR_SERVER_PTLOG_FILEPATH;
+
/* Parse command line */
for (index = 1; index < argc; index++) {
if (strcmp(argv[index], "-noauth") == 0) {
serverLogSyslog = 1;
serverLogSyslogFacility = atoi(argv[index] + 8);
#endif
+ } else if ((strcmp(argv[index], "-database") == 0)
+ || (strcmp(argv[index], "-db") == 0)) {
+ vl_dbaseName = argv[++index];
+ } else if (strcmp(argv[index], "-config") == 0) {
+ if ((index + 1) > argc) {
+ fprintf(stderr, "missing argument for -config\n");
+ return -1;
+ }
+ configDir = argv[++index];
+ } else if (strcmp(argv[index], "-logfile") == 0) {
+ if ((index + 1) > argc) {
+ fprintf(stderr, "missing argument for -logfile\n");
+ return -1;
+ }
+ logFile = argv[++index];
} else {
/* support help flag */
- printf("Usage: vlserver [-p <number of processes>] [-nojumbo] "
+ printf("Usage: vlserver [-database <db path] "
+ "[-p <number of processes>] [-nojumbo] "
"[-rxmaxmtu <bytes>] [-rxbind] [-allow-dotted-principals] "
- "[-auditlog <log path>] [-jumbo] [-d <debug level>] ");
+ "[-auditlog <log path>] [-jumbo] [-d <debug level>] "
+ "[-config <config directory path>] "
+ "[-logfile <log file path>] ");
#ifndef AFS_NT40_ENV
printf("[-syslog[=FACILITY]] ");
#endif
osi_audit_file(auditFileName);
}
- /* Initialize dirpaths */
- if (!(initAFSDirPath() & AFSDIR_SERVER_PATHS_OK)) {
-#ifdef AFS_NT40_ENV
- ReportErrorEventAlt(AFSEVT_SVR_NO_INSTALL_DIR, 0, argv[0], 0);
-#endif
- fprintf(stderr, "%s: Unable to obtain AFS server directory.\n",
- argv[0]);
- exit(2);
- }
- vl_dbaseName = AFSDIR_SERVER_VLDB_FILEPATH;
-
#ifndef AFS_NT40_ENV
serverLogSyslogTag = "vlserver";
#endif
- OpenLog(AFSDIR_SERVER_VLOG_FILEPATH); /* set up logging */
+ OpenLog(logFile); /* set up logging */
SetupLogSignals();
- tdir = afsconf_Open(AFSDIR_SERVER_ETC_DIRPATH);
+ tdir = afsconf_Open(configDir);
if (!tdir) {
printf
("vlserver: can't open configuration files in dir %s, giving up.\n",
- AFSDIR_SERVER_ETC_DIRPATH);
+ configDir);
exit(1);
}
#ifdef AFS_NT40_ENV