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/nfsiod | |
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/nfsiod')
-rw-r--r-- | sbin/nfsiod/nfsiod.8 | 22 | ||||
-rw-r--r-- | sbin/nfsiod/nfsiod.c | 14 |
2 files changed, 34 insertions, 2 deletions
diff --git a/sbin/nfsiod/nfsiod.8 b/sbin/nfsiod/nfsiod.8 index 2acd365..e2ccc67 100644 --- a/sbin/nfsiod/nfsiod.8 +++ b/sbin/nfsiod/nfsiod.8 @@ -29,9 +29,10 @@ .\" OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF .\" SUCH DAMAGE. .\" -.\" @(#)nfsiod.8 8.2 (Berkeley) 2/22/94 +.\" From: @(#)nfsiod.8 8.2 (Berkeley) 2/22/94 +.\" $Id$ .\" -.Dd February 22, 1994 +.Dd September 22, 1994 .Dt NFSIOD 8 .Os .Sh NAME @@ -60,12 +61,29 @@ Specify how many servers are to be started. A client should run enough daemons to handle its maximum level of concurrency, typically four to six. .Pp +If +.Nm nfsiod +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 nfsiod +exits with an error. +.Pp The .Nm nfsiod 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/nfsiod/nfsiod.c b/sbin/nfsiod/nfsiod.c index b742fdc..d066329 100644 --- a/sbin/nfsiod/nfsiod.c +++ b/sbin/nfsiod/nfsiod.c @@ -49,6 +49,7 @@ static char sccsid[] = "@(#)nfsiod.c 8.3 (Berkeley) 2/22/94"; #include <sys/syslog.h> #include <sys/ucred.h> #include <sys/wait.h> +#include <sys/mount.h> #include <nfs/nfsv2.h> #include <nfs/nfs.h> @@ -83,6 +84,19 @@ main(argc, argv) char *argv[]; { int ch, num_servers; + 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"); + } #define MAXNFSDCNT 20 #define DEFNFSDCNT 1 |