Author: NeilBrown <neilb@cse.unsw.edu.au>
-Date: Mon Aug 7 14:01:35 EST 2006
+Date: Mon Aug 7 16:35:03 AEST 2006
+
+ support/nfs/nfssvc.c: if any ports are already open,
+ don't try to open any more.
+ This means that once nfsd is running
+ rpc.nfsd X
+ will just change the number of threads, not the
+ ports in use.
+
+Author: NeilBrown <neilb@cse.unsw.edu.au>
+Date: Mon Aug 7 14:01:35 AEST 2006
Remove warning if neither 'sync' or 'async' present.
Add warning of neither 'subtree_check' or 'no_subtree_check' present.
static void
nfssvc_setfds(int port, unsigned int ctlbits, char *haddr)
{
- int fd, on=1;
+ int fd, n, on=1;
char buf[BUFSIZ];
int udpfd = -1, tcpfd = -1;
struct sockaddr_in sin;
+ fd = open(NFSD_PORTS_FILE, O_RDONLY);
+ if (fd < 0)
+ return;
+ n = read(fd, buf, BUFSIZ);
+ close(fd);
+ if (n != 0)
+ return;
+ /* there are no ports currently open, so it is safe to
+ * try to open some and pass them through.
+ * Note: If the user explicitly asked for 'udp', then
+ * we should probably check if that is open, and should
+ * open it if not. However we don't yet. All sockets
+ * have to be opened when the first daemon is started.
+ */
fd = open(NFSD_PORTS_FILE, O_WRONLY);
if (fd < 0)
return;
.\" nfsd(8)
.\"
.\" Copyright (C) 1999 Olaf Kirch <okir@monad.swb.de>
-.TH rpc.nfsd 8 "31 May 1999"
+.TH rpc.nfsd 8 "7 Aug 2006"
.SH NAME
rpc.nfsd \- NFS server process
.SH SYNOPSIS
the
.BR nfsstat (8)
program.
+.P
+Note that if the NFS server is already running, then the options for
+specifying host, port, and protocol will be ignored. The number of
+processes given will be the only option considered, and the number of
+active
+.B nfsd
+processes will be increased or decreased to match this number.
+In particular
+.B rpc.nfsd 0
+will stop all threads and thus close any open connections.
+
.SH SEE ALSO
.BR rpc.mountd (8),
.BR exportfs (8),