X-Git-Url: https://git.decadent.org.uk/gitweb/?a=blobdiff_plain;f=utils%2Fnfsd%2Fnfsd.c;h=2a3f5cca4ae736a41075b1ad0d1a597d3a823235;hb=7600e19437e34585af1651bb73c6ae9d2951ede8;hp=1cda1e59ca0521b4b6203de8b5d33edb94dc1559;hpb=b2a3cd590442309d40e9dd6d43213445df250694;p=nfs-utils.git diff --git a/utils/nfsd/nfsd.c b/utils/nfsd/nfsd.c index 1cda1e5..2a3f5cc 100644 --- a/utils/nfsd/nfsd.c +++ b/utils/nfsd/nfsd.c @@ -27,14 +27,9 @@ #include "nfssvc.h" #include "xlog.h" -/* - * IPv6 support for nfsd was finished before some of the other daemons (mountd - * and statd in particular). That could be a problem in the future if someone - * were to boot a kernel that supports IPv6 serving with an older nfs-utils. For - * now, hardcode the IPv6 switch into the off position until the other daemons - * are functional. - */ -#undef IPV6_SUPPORTED +#ifndef NFSD_NPROC +#define NFSD_NPROC 8 +#endif static void usage(const char *); @@ -99,11 +94,11 @@ nfsd_enable_protos(unsigned int *proto4, unsigned int *proto6) int main(int argc, char **argv) { - int count = 1, c, error = 0, portnum = 0, fd, found_one; + int count = NFSD_NPROC, c, error = 0, portnum = 0, fd, found_one; char *p, *progname, *port; char *haddr = NULL; int socket_up = 0; - int minorvers4 = NFSD_MAXMINORVERS4; /* nfsv4 minor version */ + int minorvers41 = 0; /* nfsv4 minor version */ unsigned int versbits = NFSCTL_ALLBITS; unsigned int protobits = NFSCTL_ALLBITS; unsigned int proto4 = 0; @@ -163,7 +158,12 @@ main(int argc, char **argv) switch((c = strtol(optarg, &p, 0))) { case 4: if (*p == '.') { - minorvers4 = -atoi(p + 1); + int i = atoi(p+1); + if (i != 1) { + fprintf(stderr, "%s: unsupported minor version\n", optarg); + exit(1); + } + minorvers41 = -1; break; } case 3: @@ -246,6 +246,9 @@ main(int argc, char **argv) exit(1); } + /* make sure nfsdfs is mounted if it's available */ + nfssvc_mount_nfsdfs(progname); + /* can only change number of threads if nfsd is already up */ if (nfssvc_inuse()) { socket_up = 1; @@ -257,7 +260,7 @@ main(int argc, char **argv) * registered with rpcbind. Note that on older kernels w/o the right * interfaces, these are a no-op. */ - nfssvc_setvers(versbits, minorvers4); + nfssvc_setvers(versbits, minorvers41); error = nfssvc_set_sockets(AF_INET, proto4, haddr, port); if (!error)