=for html
<div class="synopsis">
-B<ptserver> S<<< [B<-database> | B<-db> <I<db path>>] >>> S<<< [B<-p> <I<number of threads>>] >>> S<<< [B<-d> <I<debug level>>] >>>
- S<<< [B<-groupdepth> <I<# of nested groups>>] >>>
- S<<< [B<-default_access> <I<user access mask>> <I<group access mask>>] >>>
- [B<-restricted>] [B<-enable_peer_stats>]
- [B<-enable_process_stats>] [B<-allow-dotted-principals>]
- [B<-rxbind>] S<<< [B<-auditlog> <I<file path>>] >>>
- S<<< [B<-audit-interface> (file | sysvmq)] >>>
- S<<< [B<-syslog>[=<I<FACILITY>>]] >>> S<<< [B<-rxmaxmtu> <I<bytes>>] >>>
- [B<-help>]
+ptserver S<<< [B<-database> | B<-db> <I<db path>>] >>>
+S<<< [B<-p> <I<number of threads>>] >>> S<<< [B<-d> <I<debug level>>] >>>
+S<<< [B<-groupdepth> <I<# of nested groups>>] >>>
+S<<< [B<-default_access> <I<user access mask>> <I<group access mask>>] >>>
+[B<-restricted>] [B<-enable_peer_stats>]
+[B<-enable_process_stats>] [B<-allow-dotted-principals>]
+[B<-rxbind>] S<<< [B<-auditlog> <I<file path>>] >>>
+S<<< [B<-audit-interface> (file | sysvmq)] >>>
+S<<< [B<-syslog>[=<I<FACILITY>>]] >>>
+S<<< [B<-logfile <I<log file>>] >>>
+S<<< [B<-config <I<configuration path>>] >>>
+S<<< [B<-rxmaxmtu> <I<bytes>>] >>>
+[B<-help>]
=for html
</div>
the log message should be sent. Logging message sent to syslog are tagged
with the string "ptserver".
+=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/PTLog>.
+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.
+
=item B<-auditlog> <I<log path>>
Turns on audit logging, and sets the path for the audit log. The audit
afs_uint32 host = htonl(INADDR_ANY);
const char *pr_dbaseName;
+ const char *configDir;
+ const char *logFile;
char *whoami = "ptserver";
int a;
}
pr_dbaseName = AFSDIR_SERVER_PRDB_FILEPATH;
+ configDir = AFSDIR_SERVER_ETC_DIRPATH;
+ logFile = AFSDIR_SERVER_PTLOG_FILEPATH;
#if defined(SUPERGROUPS)
/* make sure the structures for database records are the same size */
RX_MAX_PACKET_DATA_SIZE);
PT_EXIT(1);
}
+ } else if (!strncmp(arg, "-config", alen)) {
+ if ((a + 1) > argc) {
+ fprintf(stderr, "missing argument for -config\n");
+ PT_EXIT(1);
+ }
+ configDir = argv[++a];
+ } else if (!strncmp(arg, "-logfile", alen)) {
+ if ((a + 1) > argc) {
+ fprintf(stderr, "missing argument for -logfile\n");
+ PT_EXIT(1);
+ }
+ logFile = argv[++a];
}
else if (*arg == '-') {
/* hack in help flag support */
printf("Usage: ptserver [-database <db path>] "
"[-auditlog <log path>] "
- "[-audit-interface <file|sysvmq> (default is file)] ");
+ "[-audit-interface <file|sysvmq> (default is file)] "
+ "[-config <config directory path>] "
+ "[-logfile <log file path>] ");
#ifndef AFS_NT40_ENV
printf("[-syslog[=FACILITY]] ");
#endif
#ifndef AFS_NT40_ENV
serverLogSyslogTag = "ptserver";
#endif
- OpenLog(AFSDIR_SERVER_PTLOG_FILEPATH); /* set up logging */
+ OpenLog(logFile); /* set up logging */
SetupLogSignals();
- prdir = afsconf_Open(AFSDIR_SERVER_ETC_DIRPATH);
+ prdir = afsconf_Open(configDir);
if (!prdir) {
fprintf(stderr, "ptserver: can't open configuration directory.\n");
PT_EXIT(1);