summaryrefslogtreecommitdiffstats
path: root/sbin/mountd
diff options
context:
space:
mode:
authorwollman <wollman@FreeBSD.org>1994-09-22 22:17:02 +0000
committerwollman <wollman@FreeBSD.org>1994-09-22 22:17:02 +0000
commiteeef7952c3836dd1eb5e994695d5c745b6b51784 (patch)
treeeae3d93fb9be635a1496c02de15cdef92b491f86 /sbin/mountd
parentd4b42cfe457790ba8db25f68e68f7c056ddc69b5 (diff)
downloadFreeBSD-src-eeef7952c3836dd1eb5e994695d5c745b6b51784.zip
FreeBSD-src-eeef7952c3836dd1eb5e994695d5c745b6b51784.tar.gz
Automatically load NFS and a bevy of other filesystems.
Diffstat (limited to 'sbin/mountd')
-rw-r--r--sbin/mountd/Makefile5
-rw-r--r--sbin/mountd/mountd.822
-rw-r--r--sbin/mountd/mountd.c20
3 files changed, 40 insertions, 7 deletions
diff --git a/sbin/mountd/Makefile b/sbin/mountd/Makefile
index 57d6b43..f32e11b 100644
--- a/sbin/mountd/Makefile
+++ b/sbin/mountd/Makefile
@@ -1,7 +1,8 @@
-# @(#)Makefile 8.3 (Berkeley) 1/25/94
+# From: @(#)Makefile 8.3 (Berkeley) 1/25/94
+# $Id$
PROG= mountd
-CFLAGS+=-DNFS -DMFS -DCD9660
+CFLAGS+=-DNFS -DMFS -DCD9660 -DMSDOSFS
MAN5= exports.5 netgroup.5
MAN8= mountd.8
diff --git a/sbin/mountd/mountd.8 b/sbin/mountd/mountd.8
index 47a6cfc..77cb9c9 100644
--- a/sbin/mountd/mountd.8
+++ b/sbin/mountd/mountd.8
@@ -29,9 +29,10 @@
.\" OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
.\" SUCH DAMAGE.
.\"
-.\" @(#)mountd.8 8.1 (Berkeley) 6/9/93
+.\" From: @(#)mountd.8 8.1 (Berkeley) 6/9/93
+.\" $Id$
.\"
-.Dd June 9, 1993
+.Dd September 22, 1994
.Dt MOUNTD 8
.Os
.Sh NAME
@@ -81,6 +82,22 @@ After sending the SIGHUP
(kill -HUP `cat /var/run/mountd.pid`),
check the syslog output to see if mountd logged any parsing
errors in the exports file.
+.Pp
+If
+.Nm mountd
+detects that the running kernel does not include
+.Tn NFS
+support, it will attempt to load a loadable kernel module containing
+.Tn NFS
+code, using
+.Xr modload 8
+by way of
+.Xr vfsload 3 .
+If this fails, or no
+.Tn NFS
+LKM was available,
+.Nm mountd
+exits with an error.
.Sh FILES
.Bl -tag -width /var/run/mountd.pid -compact
.It Pa /etc/exports
@@ -91,6 +108,7 @@ the pid of the currently running mountd
.Sh SEE ALSO
.Xr nfsstat 1 ,
.Xr exports 5 ,
+.Xr modload 8 ,
.Xr nfsd 8 ,
.Xr portmap 8 ,
.Xr showmount 8
diff --git a/sbin/mountd/mountd.c b/sbin/mountd/mountd.c
index e674150..605e31f 100644
--- a/sbin/mountd/mountd.c
+++ b/sbin/mountd/mountd.c
@@ -38,11 +38,13 @@
static char copyright[] =
"@(#) Copyright (c) 1989, 1993\n\
The Regents of the University of California. All rights reserved.\n";
-#endif not lint
+#endif /*not lint*/
#ifndef lint
-static char sccsid[] = "@(#)mountd.c 8.8 (Berkeley) 2/20/94";
-#endif not lint
+/*static char sccsid[] = "From: @(#)mountd.c 8.8 (Berkeley) 2/20/94";*/
+static const char rcsid[] =
+ "$Id$";
+#endif /*not lint*/
#include <sys/param.h>
#include <sys/file.h>
@@ -235,6 +237,18 @@ main(argc, argv)
{
SVCXPRT *transp;
int c;
+ struct vfsconf *vfc;
+
+ vfc = getvfsbyname("nfs");
+ if(!vfc && vfsisloadable("nfs")) {
+ if(vfsload("nfs"))
+ err(1, "vfsload(nfs)");
+ endvfsent(); /* flush cache */
+ vfc = getvfsbyname("nfs");
+ }
+ if(!vfc) {
+ errx(1, "NFS support is not available in the running kernel");
+ }
while ((c = getopt(argc, argv, "n")) != EOF)
switch (c) {
OpenPOWER on IntegriCloud