diff options
Diffstat (limited to 'usr.sbin/nfsd')
-rw-r--r-- | usr.sbin/nfsd/nfsd.8 | 18 | ||||
-rw-r--r-- | usr.sbin/nfsd/nfsd.c | 12 |
2 files changed, 30 insertions, 0 deletions
diff --git a/usr.sbin/nfsd/nfsd.8 b/usr.sbin/nfsd/nfsd.8 index 4ee6c4b..a54a564 100644 --- a/usr.sbin/nfsd/nfsd.8 +++ b/usr.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/usr.sbin/nfsd/nfsd.c b/usr.sbin/nfsd/nfsd.c index 8e2d14c..9d4d226 100644 --- a/usr.sbin/nfsd/nfsd.c +++ b/usr.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; |