#include <afsconfig.h>
#include <afs/param.h>
+#include <afs/procmgmt.h>
+#include <roken.h>
#include <stdio.h>
#include <stdlib.h>
int sendBufSize = 16384; /* send buffer size */
int saneacls = 0; /* Sane ACLs Flag */
static int unsafe_attach = 0; /* avoid inUse check on vol attach? */
+static int offline_timeout = -1; /* -offline-timeout option */
+static int offline_shutdown_timeout = -1; /* -offline-shutdown-timeout option */
struct timeval tp;
fputs("[-abortthreshold <abort threshold>] ", stdout);
fputs("[-nojumbo (disable jumbogram network packets - deprecated)] ", stdout);
fputs("[-jumbo (enable jumbogram network packets)] ", stdout);
+ fputs("[-offline-timeout <client RX timeout for offlining volumes>]", stdout);
+ fputs("[-offline-shutdown-timeout <RX timeout for offlining volumes during shutdown>]", stdout);
/* fputs("[-enable_peer_stats] ", stdout); */
/* fputs("[-enable_process_stats] ", stdout); */
fputs("[-help]\n", stdout);
int Sawbusy = 0;
int i;
int bufSize = 0; /* temp variable to read in udp socket buf size */
+ int lwps_max;
char *auditFileName = NULL;
for (i = 1; i < argc; i++) {
} else if (!strcmp(argv[i], "-S")) {
SawS = 1;
} else if (!strcmp(argv[i], "-p")) {
- int lwps_max =
- max_fileserver_thread() - FILESERVER_HELPER_THREADS;
Sawlwps = 1;
if ((i + 1) >= argc) {
fprintf(stderr, "missing argument for -p\n");
return -1;
}
lwps = atoi(argv[++i]);
- if (lwps > lwps_max)
- lwps = lwps_max;
- else if (lwps < 6)
- lwps = 6;
} else if (!strcmp(argv[i], "-b")) {
Sawbufs = 1;
if ((i + 1) >= argc) {
else if (strcmp(argv[i], "-saneacls") == 0) {
saneacls = 1;
}
+ else if (strcmp(argv[i], "-offline-timeout") == 0) {
+ if (i + 1 >= argc) {
+ printf("You have to specify -offline-timeout <integer>\n");
+ return -1;
+ }
+ offline_timeout = atoi(argv[++i]);
+#ifndef AFS_PTHREAD_ENV
+ if (offline_timeout != -1) {
+ printf("The only valid -offline-timeout value for the LWP "
+ "fileserver is -1\n");
+ return -1;
+ }
+#endif /* AFS_PTHREAD_ENV */
+ if (offline_timeout < -1) {
+ printf("Invalid -offline-timeout value %s; the only valid "
+ "negative value is -1\n", argv[i]);
+ return -1;
+ }
+ }
+ else if (strcmp(argv[i], "-offline-shutdown-timeout") == 0) {
+ if (i + 1 >= argc) {
+ printf("You have to specify -offline-shutdown-timeout "
+ "<integer>\n");
+ return -1;
+ }
+ offline_shutdown_timeout = atoi(argv[++i]);
+#ifndef AFS_PTHREAD_ENV
+ if (offline_shutdown_timeout != -1) {
+ printf("The only valid -offline-shutdown-timeout value for the "
+ "LWP fileserver is -1\n");
+ return -1;
+ }
+#endif /* AFS_PTHREAD_ENV */
+ if (offline_shutdown_timeout < -1) {
+ printf("Invalid -offline-timeout value %s; the only valid "
+ "negative value is -1\n", argv[i]);
+ return -1;
+ }
+ }
else {
return (-1);
}
if (auditFileName)
osi_audit_file(auditFileName);
+ lwps_max = max_fileserver_thread() - FILESERVER_HELPER_THREADS;
+ if (lwps > lwps_max)
+ lwps = lwps_max;
+ else if (lwps < 6)
+ lwps = 6;
+
return (0);
} /*ParseArgs */
opts.nSmallVnodes = nSmallVns;
opts.volcache = volcache;
opts.unsafe_attach = unsafe_attach;
+ if (offline_timeout != -1) {
+ opts.interrupt_rxcall = rx_InterruptCall;
+ opts.offline_timeout = offline_timeout;
+ }
+ if (offline_shutdown_timeout == -1) {
+ /* default to -offline-timeout, if shutdown-specific timeout is not
+ * specified */
+ opts.offline_shutdown_timeout = offline_timeout;
+ } else {
+ opts.interrupt_rxcall = rx_InterruptCall;
+ opts.offline_shutdown_timeout = offline_shutdown_timeout;
+ }
if (VInitVolumePackage2(fileServer, &opts)) {
ViceLog(0,
FT_GetTimeOfDay(&tp, 0);
- ViceLog(0, ("File server has started at %s",
- afs_ctime((time_t *)&(tp.tv_sec), tbuffer, sizeof(tbuffer))));
-
/*
* Figure out the FileServer's name and primary address.
*/