diff options
-rw-r--r-- | etc/defaults/rc.conf | 1 | ||||
-rwxr-xr-x | etc/rc.d/nfsd | 6 | ||||
-rwxr-xr-x | etc/rc.d/nfsuserd | 9 |
3 files changed, 15 insertions, 1 deletions
diff --git a/etc/defaults/rc.conf b/etc/defaults/rc.conf index 4c0e899..31a106a 100644 --- a/etc/defaults/rc.conf +++ b/etc/defaults/rc.conf @@ -326,6 +326,7 @@ nfs_client_enable="NO" # This host is an NFS client (or NO). nfs_access_cache="60" # Client cache timeout in seconds nfs_server_enable="NO" # This host is an NFS server (or NO). nfs_server_flags="-u -t" # Flags to nfsd (if enabled). +nfs_server_managegids="NO" # The NFS server maps gids for AUTH_SYS (or NO). mountd_enable="NO" # Run mountd (or NO). mountd_flags="-r" # Flags to mountd (if NFS server enabled). weak_mountd_authentication="NO" # Allow non-root mount requests to be served. diff --git a/etc/rc.d/nfsd b/etc/rc.d/nfsd index 8c67308..fefe390 100755 --- a/etc/rc.d/nfsd +++ b/etc/rc.d/nfsd @@ -32,9 +32,13 @@ nfsd_precmd() sysctl vfs.nfsd.nfs_privport=0 > /dev/null fi + if checkyesno nfsv4_server_enable || \ + checkyesno nfs_server_managegids; then + force_depend nfsuserd || err 1 "Cannot run nfsuserd" + fi + if checkyesno nfsv4_server_enable; then sysctl vfs.nfsd.server_max_nfsvers=4 > /dev/null - force_depend nfsuserd || err 1 "Cannot run nfsuserd" else echo 'NFSv4 is disabled' sysctl vfs.nfsd.server_max_nfsvers=3 > /dev/null diff --git a/etc/rc.d/nfsuserd b/etc/rc.d/nfsuserd index 52246bb..d98d16e 100755 --- a/etc/rc.d/nfsuserd +++ b/etc/rc.d/nfsuserd @@ -15,5 +15,14 @@ command="/usr/sbin/${name}" sig_stop="USR1" load_rc_config $name +start_precmd="nfsuserd_precmd" + +nfsuserd_precmd() +{ + if checkyesno nfs_server_managegids; then + rc_flags="-manage-gids ${nfsuserd_flags}" + fi + return 0 +} run_rc_command "$1" |