aboutsummaryrefslogtreecommitdiffstats
path: root/sbin/nfsiod
diff options
context:
space:
mode:
authorGarrett Wollman <wollman@FreeBSD.org>1994-09-22 22:17:02 +0000
committerGarrett Wollman <wollman@FreeBSD.org>1994-09-22 22:17:02 +0000
commitd599144d24b887e1736c0e5470d56248bcc45160 (patch)
treeeae3d93fb9be635a1496c02de15cdef92b491f86 /sbin/nfsiod
parent42477d75d038de2ef2d8cbb77644f63f56d2076f (diff)
downloadsrc-d599144d24b887e1736c0e5470d56248bcc45160.tar.gz
src-d599144d24b887e1736c0e5470d56248bcc45160.zip
Automatically load NFS and a bevy of other filesystems.
Notes
Notes: svn path=/head/; revision=2999
Diffstat (limited to 'sbin/nfsiod')
-rw-r--r--sbin/nfsiod/nfsiod.822
-rw-r--r--sbin/nfsiod/nfsiod.c14
2 files changed, 34 insertions, 2 deletions
diff --git a/sbin/nfsiod/nfsiod.8 b/sbin/nfsiod/nfsiod.8
index 2acd3651ca18..e2ccc67130d8 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 b742fdc114f6..d066329ab4d9 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