diff options
-rw-r--r-- | etc/network.subr | 13 | ||||
-rw-r--r-- | etc/rc | 21 | ||||
-rw-r--r-- | etc/rc.d/netoptions | 13 | ||||
-rw-r--r-- | etc/rc.d/network1 | 13 | ||||
-rw-r--r-- | etc/rc.d/network2 | 13 | ||||
-rw-r--r-- | etc/rc.d/network3 | 13 | ||||
-rw-r--r-- | etc/rc.d/routing | 13 | ||||
-rw-r--r-- | etc/rc.network | 13 |
8 files changed, 102 insertions, 10 deletions
diff --git a/etc/network.subr b/etc/network.subr index 67c88a0..8f3f5a6 100644 --- a/etc/network.subr +++ b/etc/network.subr @@ -605,7 +605,16 @@ network_pass3() { [Yy][Ee][Ss]) case ${nfs_server_enable} in [Yy][Ee][Ss]) - if [ -r /etc/exports ]; then + # Handle absent nfs server support + nfsserver_in_kernel=0 + if sysctl vfs.nfsrv >/dev/null 2>&1; then + nfsserver_in_kernel=1 + else + kldload nfsserver && nfsserver_in_kernel=1 + fi + + if [ -r /etc/exports -a \ + ${nfsserver_in_kernel} -eq 1 ]; then echo -n ' mountd' case ${weak_mountd_authentication} in @@ -636,6 +645,8 @@ network_pass3() { echo -n ' rpc.statd'; rpc.statd ;; esac + else + echo -n ' Warning: nfs server failed' fi ;; *) @@ -406,9 +406,24 @@ esac # Mount NFS filesystems if present in /etc/fstab case "`mount -d -a -t nfs 2> /dev/null`" in *mount_nfs*) - echo -n 'Mounting NFS file systems:' - mount -a -t nfs - echo '.' + # Handle absent nfs client support + nfsclient_in_kernel=0 + if sysctl vfs.nfs >/dev/null 2>&1; then + nfsclient_in_kernel=1 + else + kldload nfsclient && nfsclient_in_kernel=1 + fi + + case ${nfsclient_in_kernel} in + 1) + echo -n 'Mounting NFS file systems:' + mount -a -t nfs + echo '.' + ;; + *) + echo 'Warning: nfs mount requested, but no nfs client in kernel' + ;; + esac ;; esac diff --git a/etc/rc.d/netoptions b/etc/rc.d/netoptions index 67c88a0..8f3f5a6 100644 --- a/etc/rc.d/netoptions +++ b/etc/rc.d/netoptions @@ -605,7 +605,16 @@ network_pass3() { [Yy][Ee][Ss]) case ${nfs_server_enable} in [Yy][Ee][Ss]) - if [ -r /etc/exports ]; then + # Handle absent nfs server support + nfsserver_in_kernel=0 + if sysctl vfs.nfsrv >/dev/null 2>&1; then + nfsserver_in_kernel=1 + else + kldload nfsserver && nfsserver_in_kernel=1 + fi + + if [ -r /etc/exports -a \ + ${nfsserver_in_kernel} -eq 1 ]; then echo -n ' mountd' case ${weak_mountd_authentication} in @@ -636,6 +645,8 @@ network_pass3() { echo -n ' rpc.statd'; rpc.statd ;; esac + else + echo -n ' Warning: nfs server failed' fi ;; *) diff --git a/etc/rc.d/network1 b/etc/rc.d/network1 index 67c88a0..8f3f5a6 100644 --- a/etc/rc.d/network1 +++ b/etc/rc.d/network1 @@ -605,7 +605,16 @@ network_pass3() { [Yy][Ee][Ss]) case ${nfs_server_enable} in [Yy][Ee][Ss]) - if [ -r /etc/exports ]; then + # Handle absent nfs server support + nfsserver_in_kernel=0 + if sysctl vfs.nfsrv >/dev/null 2>&1; then + nfsserver_in_kernel=1 + else + kldload nfsserver && nfsserver_in_kernel=1 + fi + + if [ -r /etc/exports -a \ + ${nfsserver_in_kernel} -eq 1 ]; then echo -n ' mountd' case ${weak_mountd_authentication} in @@ -636,6 +645,8 @@ network_pass3() { echo -n ' rpc.statd'; rpc.statd ;; esac + else + echo -n ' Warning: nfs server failed' fi ;; *) diff --git a/etc/rc.d/network2 b/etc/rc.d/network2 index 67c88a0..8f3f5a6 100644 --- a/etc/rc.d/network2 +++ b/etc/rc.d/network2 @@ -605,7 +605,16 @@ network_pass3() { [Yy][Ee][Ss]) case ${nfs_server_enable} in [Yy][Ee][Ss]) - if [ -r /etc/exports ]; then + # Handle absent nfs server support + nfsserver_in_kernel=0 + if sysctl vfs.nfsrv >/dev/null 2>&1; then + nfsserver_in_kernel=1 + else + kldload nfsserver && nfsserver_in_kernel=1 + fi + + if [ -r /etc/exports -a \ + ${nfsserver_in_kernel} -eq 1 ]; then echo -n ' mountd' case ${weak_mountd_authentication} in @@ -636,6 +645,8 @@ network_pass3() { echo -n ' rpc.statd'; rpc.statd ;; esac + else + echo -n ' Warning: nfs server failed' fi ;; *) diff --git a/etc/rc.d/network3 b/etc/rc.d/network3 index 67c88a0..8f3f5a6 100644 --- a/etc/rc.d/network3 +++ b/etc/rc.d/network3 @@ -605,7 +605,16 @@ network_pass3() { [Yy][Ee][Ss]) case ${nfs_server_enable} in [Yy][Ee][Ss]) - if [ -r /etc/exports ]; then + # Handle absent nfs server support + nfsserver_in_kernel=0 + if sysctl vfs.nfsrv >/dev/null 2>&1; then + nfsserver_in_kernel=1 + else + kldload nfsserver && nfsserver_in_kernel=1 + fi + + if [ -r /etc/exports -a \ + ${nfsserver_in_kernel} -eq 1 ]; then echo -n ' mountd' case ${weak_mountd_authentication} in @@ -636,6 +645,8 @@ network_pass3() { echo -n ' rpc.statd'; rpc.statd ;; esac + else + echo -n ' Warning: nfs server failed' fi ;; *) diff --git a/etc/rc.d/routing b/etc/rc.d/routing index 67c88a0..8f3f5a6 100644 --- a/etc/rc.d/routing +++ b/etc/rc.d/routing @@ -605,7 +605,16 @@ network_pass3() { [Yy][Ee][Ss]) case ${nfs_server_enable} in [Yy][Ee][Ss]) - if [ -r /etc/exports ]; then + # Handle absent nfs server support + nfsserver_in_kernel=0 + if sysctl vfs.nfsrv >/dev/null 2>&1; then + nfsserver_in_kernel=1 + else + kldload nfsserver && nfsserver_in_kernel=1 + fi + + if [ -r /etc/exports -a \ + ${nfsserver_in_kernel} -eq 1 ]; then echo -n ' mountd' case ${weak_mountd_authentication} in @@ -636,6 +645,8 @@ network_pass3() { echo -n ' rpc.statd'; rpc.statd ;; esac + else + echo -n ' Warning: nfs server failed' fi ;; *) diff --git a/etc/rc.network b/etc/rc.network index 67c88a0..8f3f5a6 100644 --- a/etc/rc.network +++ b/etc/rc.network @@ -605,7 +605,16 @@ network_pass3() { [Yy][Ee][Ss]) case ${nfs_server_enable} in [Yy][Ee][Ss]) - if [ -r /etc/exports ]; then + # Handle absent nfs server support + nfsserver_in_kernel=0 + if sysctl vfs.nfsrv >/dev/null 2>&1; then + nfsserver_in_kernel=1 + else + kldload nfsserver && nfsserver_in_kernel=1 + fi + + if [ -r /etc/exports -a \ + ${nfsserver_in_kernel} -eq 1 ]; then echo -n ' mountd' case ${weak_mountd_authentication} in @@ -636,6 +645,8 @@ network_pass3() { echo -n ' rpc.statd'; rpc.statd ;; esac + else + echo -n ' Warning: nfs server failed' fi ;; *) |