- New sysconfig variables

NFS4_SERVER_MINOR_VERSION, GSSD_OPTIONS,
   NFS_GSSD_AVOID_DNS
  to enable various configurations.
- bug fixes to init scripts to avoid unmounting everything(!)
  and to avoid corrupting /run/nfs/bind.mounts

OBS-URL: https://build.opensuse.org/package/show/Base:System/nfs-utils?expand=0&rev=88
This commit is contained in:
Neil Brown 2013-07-22 06:50:28 +00:00 committed by Git OBS Bridge
parent 3ade29ac96
commit 1659d2c52f
4 changed files with 75 additions and 17 deletions

View File

@ -1,3 +1,13 @@
-------------------------------------------------------------------
Mon Jul 22 06:47:57 UTC 2013 - nfbrown@suse.com
- New sysconfig variables
NFS4_SERVER_MINOR_VERSION, GSSD_OPTIONS,
NFS_GSSD_AVOID_DNS
to enable various configurations.
- bug fixes to init scripts to avoid unmounting everything(!)
and to avoid corrupting /run/nfs/bind.mounts
------------------------------------------------------------------- -------------------------------------------------------------------
Mon Jul 22 06:12:53 UTC 2013 - nfbrown@suse.com Mon Jul 22 06:12:53 UTC 2013 - nfbrown@suse.com

View File

@ -17,7 +17,7 @@
# Required-Stop: $network $portmap # Required-Stop: $network $portmap
# Default-Start: 3 5 # Default-Start: 3 5
# Default-Stop: 0 1 2 6 # Default-Stop: 0 1 2 6
# Short-Description: NFS client services # Short-Description: NFS client services
# Description: All necessary services for NFS clients # Description: All necessary services for NFS clients
### END INIT INFO ### END INIT INFO
@ -94,6 +94,15 @@ esac
if test -n "$flavors" ; then if test -n "$flavors" ; then
NEED_GSSD=yes NEED_GSSD=yes
fi fi
if test -n "$GSSD_OPTIONS"; then
NEED_GSSD=yes
fi
case $NFS_GSSD_AVOID_DNS in
[Nn]*) ignore_dns=-D ;;
[Yy]*) ignore_dns= ;;
* ) ignore_dns=-D
esac
if test "$NFS4_SUPPORT" = yes ; then if test "$NFS4_SUPPORT" = yes ; then
NEED_IDMAPD=yes NEED_IDMAPD=yes
@ -153,7 +162,7 @@ do_start_gssd() {
/sbin/modprobe rpcsec_gss_$flavor /sbin/modprobe rpcsec_gss_$flavor
done done
mount_rpc_pipefs mount_rpc_pipefs
startproc $GSSD_BIN startproc $GSSD_BIN $ignore_dns $GSSD_OPTIONS
return $? return $?
} }
@ -196,7 +205,7 @@ case "$1-$nfs" in
modprobe nfs modprobe nfs
grep -E '^(sunrpc|fs.nfs)' /etc/sysctl.conf | sysctl -q -e -n -p - grep -E '^(sunrpc|fs.nfs)' /etc/sysctl.conf | sysctl -q -e -n -p -
# in case we need /usr and/or /opt via nfs # in case we need /usr and/or /opt via nfs
mount_usr mount_usr
# sm-notify # sm-notify
@ -231,10 +240,10 @@ case "$1-$nfs" in
# It's sometime usefull to mount NFS devices in # It's sometime usefull to mount NFS devices in
# background with an ampersand (&) and a sleep time of # background with an ampersand (&) and a sleep time of
# two or more seconds, e.g: # two or more seconds, e.g:
# #
# sleep 2 && mount -at nfs,nfs4 & # sleep 2 && mount -at nfs,nfs4 &
# sleep 2 # sleep 2
# #
if test -n "$mnt" ; then if test -n "$mnt" ; then
# If network devices are not yet discovered, mounts # If network devices are not yet discovered, mounts
# might fail, so we might need to 'udevadm settle' to # might fail, so we might need to 'udevadm settle' to
@ -268,7 +277,7 @@ case "$1-$nfs" in
# kill process to maximise chance that umount succeeds # kill process to maximise chance that umount succeeds
mnt=`awk '$3 ~ /^nfs4*$/ {print $2}' /proc/mounts` mnt=`awk '$3 ~ /^nfs4*$/ {print $2}' /proc/mounts`
runlevel=`runlevel | awk '{print $2}'` runlevel=`runlevel | awk '{print $2}'`
if test "$runlevel" -eq 0 -o "$runlevel" -eq 6; then if test "$runlevel" -eq 0 -o "$runlevel" -eq 6; then
if test -n "$mnt" ; then if test -n "$mnt" ; then
/sbin/mkill -TERM $mnt /sbin/mkill -TERM $mnt
fi fi
@ -293,7 +302,7 @@ case "$1-$nfs" in
killproc $IDMAPD_BIN killproc $IDMAPD_BIN
fi fi
rm -f $IDMAPD_CLIENT_STATE rm -f $IDMAPD_CLIENT_STATE
fi fi
# stop rpc.statd if not needed by server # stop rpc.statd if not needed by server
if checkproc $STATD_BIN ; then if checkproc $STATD_BIN ; then
@ -334,7 +343,7 @@ case "$1-$nfs" in
echo "gssd not running" echo "gssd not running"
rc_failed 3 rc_failed 3
fi fi
# #
if test "$NEED_IDMAPD" = yes && ! checkproc $IDMAPD_BIN; then if test "$NEED_IDMAPD" = yes && ! checkproc $IDMAPD_BIN; then
echo "idmapd not running" echo "idmapd not running"
rc_failed 3 rc_failed 3
@ -354,7 +363,7 @@ case "$1-$nfs" in
if checkproc ${GSSD_BIN##*/}; then if checkproc ${GSSD_BIN##*/}; then
echo -n " gssd" echo -n " gssd"
killproc ${GSSD_BIN##*/} killproc ${GSSD_BIN##*/}
startproc $GSSD_BIN startproc $GSSD_BIN $ignore_dns $GSSD_OPTIONS
fi fi
if checkproc ${IDMAPD_BIN##*/}; then if checkproc ${IDMAPD_BIN##*/}; then
echo -n " idmapd" echo -n " idmapd"

View File

@ -44,7 +44,7 @@ rc_reset
# 5 - program is not installed # 5 - program is not installed
# 6 - program is not configured # 6 - program is not configured
# 7 - program is not running # 7 - program is not running
# #
# Note that starting an already running service, stopping # Note that starting an already running service, stopping
# or restarting a not-running service as well as the restart # or restarting a not-running service as well as the restart
# with force-reload (in case signalling is not supported) are # with force-reload (in case signalling is not supported) are
@ -108,7 +108,7 @@ nfs4_bind_mounts() {
echo "NFS: Is it no longer needed and may cease to work." echo "NFS: Is it no longer needed and may cease to work."
echo "NFS: Please remove these settings." echo "NFS: Please remove these settings."
warned=yes warned=yes
fi fi >&2
test -d "$export" || mkdir -p "$export" test -d "$export" || mkdir -p "$export"
mount -o bind "$dir" "$export" mount -o bind "$dir" "$export"
echo "$dir" "$export" echo "$dir" "$export"
@ -118,7 +118,7 @@ nfs4_bind_mounts() {
nfs4_unbind_mounts() { nfs4_unbind_mounts() {
sort -r -k2 $NFSD_BIND_MOUNTS | sort -r -k2 $NFSD_BIND_MOUNTS |
while read src mountpoint crap; do while read src mountpoint crap; do
umount -l "$mountpoint" [ -n "$mountpoint" ] && umount -l "$mountpoint"
done done
> $NFSD_BIND_MOUNTS > $NFSD_BIND_MOUNTS
} }
@ -188,6 +188,9 @@ case "$1" in
if [ "$NFS4_SUPPORT" != "yes" ]; then if [ "$NFS4_SUPPORT" != "yes" ]; then
VERSION_PARAMS="--no-nfs-version 4" VERSION_PARAMS="--no-nfs-version 4"
fi fi
if [ "$NFS4_SERVER_MINOR_VERSION" != "0" ]; then
VERSION_PARAMS="$VERSION_PARAMS -nfs-version 4 -nfs-version 4.$NFS4_SERVER_MINOR_VERSION"
fi
if [ -n "$NFSV4LEASETIME" -a -f /proc/fs/nfsd/nfsv4leasetime ]; then if [ -n "$NFSV4LEASETIME" -a -f /proc/fs/nfsd/nfsv4leasetime ]; then
echo "$NFSV4LEASETIME" > /proc/fs/nfsd/nfsv4leasetime echo "$NFSV4LEASETIME" > /proc/fs/nfsd/nfsv4leasetime
fi fi
@ -211,7 +214,7 @@ case "$1" in
echo $IDMAPD_BIN > $IDMAPD_SERVER_STATE echo $IDMAPD_BIN > $IDMAPD_SERVER_STATE
fi fi
# exportfs # exportfs
/usr/sbin/exportfs -r /usr/sbin/exportfs -r
# rpc.mountd # rpc.mountd
echo -n " mountd" echo -n " mountd"
if [ -n "$MOUNTD_PORT" ] ; then if [ -n "$MOUNTD_PORT" ] ; then
@ -295,7 +298,7 @@ case "$1" in
rc_status -v rc_status -v
;; ;;
try-restart) try-restart)
## Stop the service and if this succeeds (i.e. the ## Stop the service and if this succeeds (i.e. the
## service was running before), start it again. ## service was running before), start it again.
$0 status >/dev/null && $0 restart $0 status >/dev/null && $0 restart
@ -339,7 +342,7 @@ case "$1" in
echo -n " idmapd" echo -n " idmapd"
checkproc $IDMAPD_BIN checkproc $IDMAPD_BIN
rc_status -v rc_status -v
fi fi
echo -n " mountd" echo -n " mountd"
checkproc /usr/sbin/rpc.mountd checkproc /usr/sbin/rpc.mountd
rc_status -v rc_status -v

View File

@ -49,15 +49,28 @@ NFS3_SERVER_SUPPORT="yes"
## Default: yes ## Default: yes
## ServiceRestart: nfs nfsserver ## ServiceRestart: nfs nfsserver
# #
# Enable NFSv4 support (yes/no) # Enable NFSv4 support (server and/or client) (yes/no)
# #
NFS4_SUPPORT="yes" NFS4_SUPPORT="yes"
## Path: Network/File systems/NFS server
## Description: NFSv4 server minor version
## Type: integer
## Default: 0
## ServiceRestart: nfsserver
#
# Select NFSv4 minor version for server to support (0, 1).
# If '1' is selected, NFSv4.0 will also be supported.
NFS4_SERVER_MINOR_VERSION="0"
## Path: Network/File systems/NFS server ## Path: Network/File systems/NFS server
## Description: Network Status Monitor options ## Description: Network Status Monitor options
## Type: string ## Type: string
## Default: "" ## Default: ""
# #
# If a fixed port should be used to send reboot notification
# messages to other systems, that port should be given
# here as "-p portnumber".
# #
SM_NOTIFY_OPTIONS="" SM_NOTIFY_OPTIONS=""
@ -133,6 +146,16 @@ SVCGSSD_OPTIONS=""
# -H <shared_hostname> in a high-availability configuration. # -H <shared_hostname> in a high-availability configuration.
NFSD_OPTIONS="" NFSD_OPTIONS=""
## Path: Network/File systems/NFS server
## Description: Extra options for gssd
## Type: string
## Default: ""
#
# Normally gssd does not require any options. In some circumstances,
# -n, -l or other options might be useful. See "man 8 rpc.gssd" for
# details. Those options can be set here.
GSSD_OPTIONS=""
## Path: Network/File systems/NFS server ## Path: Network/File systems/NFS server
## Description: Extra options for mountd ## Description: Extra options for mountd
## Type: string ## Type: string
@ -142,3 +165,16 @@ NFSD_OPTIONS=""
# such as --manage-gids. # such as --manage-gids.
MOUNTD_OPTIONS="" MOUNTD_OPTIONS=""
## Path: Network/File systems/NFS server
## Description: Avoid DNS lookups for kerberos principal
## Type: yesno
## Default: no
## ServiceRestart: gssd
#
# Avoid DNS lookups when determining kerberos identity
# of NFS server (yes/no)
# "yes" is safest, but "no" might be needed to preserve
# correct behaviour at sites that don't use
# Fully Qualified Domain Names when mounting NFS Shares.
#
NFS_GSSD_AVOID_DNS="no"