diff options
author | wollman <wollman@FreeBSD.org> | 1994-09-22 22:17:02 +0000 |
---|---|---|
committer | wollman <wollman@FreeBSD.org> | 1994-09-22 22:17:02 +0000 |
commit | eeef7952c3836dd1eb5e994695d5c745b6b51784 (patch) | |
tree | eae3d93fb9be635a1496c02de15cdef92b491f86 /sbin/nfsd | |
parent | d4b42cfe457790ba8db25f68e68f7c056ddc69b5 (diff) | |
download | FreeBSD-src-eeef7952c3836dd1eb5e994695d5c745b6b51784.zip FreeBSD-src-eeef7952c3836dd1eb5e994695d5c745b6b51784.tar.gz |
Automatically load NFS and a bevy of other filesystems.
Diffstat (limited to 'sbin/nfsd')
-rw-r--r-- | sbin/nfsd/nfsd.8 | 18 | ||||
-rw-r--r-- | sbin/nfsd/nfsd.c | 12 |
2 files changed, 30 insertions, 0 deletions
diff --git a/sbin/nfsd/nfsd.8 b/sbin/nfsd/nfsd.8 index 4ee6c4b..a54a564 100644 --- a/sbin/nfsd/nfsd.8 +++ b/sbin/nfsd/nfsd.8 @@ -100,12 +100,30 @@ server specification; see .%T "Network File System Protocol Specification" , RFC1094. .Pp +If +.Nm nfsd +detects that +.Tn NFS +is not loaded in the running kernel, it will attempt +to load a loadable kernel module containing +.Tn NFS +support using +.Xr modload 8 +by way of +.Xr vfsload 3 . +If this fails, or no +.Tn NFS +LKM is available, +.Nm nfsd +will exit with an error. +.Pp The .Nm nfsd utility exits 0 on success, and >0 if an error occurs. .Sh SEE ALSO .Xr nfsstat 1 , .Xr nfssvc 2 , +.Xr modload 8 , .Xr mountd 8 , .Xr portmap 8 .Sh HISTORY diff --git a/sbin/nfsd/nfsd.c b/sbin/nfsd/nfsd.c index 8e2d14c..9d4d226 100644 --- a/sbin/nfsd/nfsd.c +++ b/sbin/nfsd/nfsd.c @@ -144,6 +144,18 @@ main(argc, argv, envp) int nfsdcnt, nfssvc_flag, on, reregister, sock, tcpflag, tcpsock; int tp4cnt, tp4flag, tp4sock, tpipcnt, tpipflag, tpipsock, udpflag; char *cp, **cpp; + struct vfsconf *vfc; + + vfc = getvfsbyname("nfs"); + if(!vfc && vfsisloadable("nfs")) { + if(vfsload("nfs")) + err(1, "vfsload(nfs)"); + endvfsent(); /* flush cache */ + vfc = getvfsbyname("nfs"); /* probably unnecessary */ + } + if(!vfc) { + errx(1, "NFS is not available in the running kernel"); + } /* Save start and extent of argv for setproctitle. */ Argv = argv; |