forked from pool/nfs-utils
This commit is contained in:
parent
466f766636
commit
4b95d2850c
@ -1,3 +1,11 @@
|
|||||||
|
-------------------------------------------------------------------
|
||||||
|
Wed Aug 13 13:19:33 CEST 2008 - werner@suse.de
|
||||||
|
|
||||||
|
- Fix boot script and use correct Stop tags
|
||||||
|
- The nfs boot script uses lazy umount and terminates process
|
||||||
|
on shutdown in case of causing busy mounts
|
||||||
|
- The nfs boot script may parse /etc/fstab only once
|
||||||
|
|
||||||
-------------------------------------------------------------------
|
-------------------------------------------------------------------
|
||||||
Wed Jul 23 16:42:58 CEST 2008 - hare@suse.de
|
Wed Jul 23 16:42:58 CEST 2008 - hare@suse.de
|
||||||
|
|
||||||
|
@ -2,9 +2,16 @@
|
|||||||
# spec file for package nfs-utils (Version 1.1.2)
|
# spec file for package nfs-utils (Version 1.1.2)
|
||||||
#
|
#
|
||||||
# Copyright (c) 2008 SUSE LINUX Products GmbH, Nuernberg, Germany.
|
# Copyright (c) 2008 SUSE LINUX Products GmbH, Nuernberg, Germany.
|
||||||
# This file and all modifications and additions to the pristine
|
|
||||||
# package are under the same license as the package itself.
|
|
||||||
#
|
#
|
||||||
|
# All modifications and additions to the file contributed by third parties
|
||||||
|
# remain the property of their copyright owners, unless otherwise agreed
|
||||||
|
# upon. The license for this file, and modifications and additions to the
|
||||||
|
# file, is the same license as for the pristine package itself (unless the
|
||||||
|
# license for the pristine package is not an Open Source License, in which
|
||||||
|
# case the license is the MIT License). An "Open Source License" is a
|
||||||
|
# license that conforms to the Open Source Definition (Version 1.9)
|
||||||
|
# published by the Open Source Initiative.
|
||||||
|
|
||||||
# Please submit bugfixes or comments via http://bugs.opensuse.org/
|
# Please submit bugfixes or comments via http://bugs.opensuse.org/
|
||||||
#
|
#
|
||||||
|
|
||||||
@ -15,7 +22,7 @@ BuildRequires: e2fsprogs-devel gcc-c++ krb5-devel libevent libgssglue-devel lib
|
|||||||
Url: http://nfs.sourceforge.net
|
Url: http://nfs.sourceforge.net
|
||||||
Summary: Support Utilities for Kernel nfsd
|
Summary: Support Utilities for Kernel nfsd
|
||||||
Version: 1.1.2
|
Version: 1.1.2
|
||||||
Release: 13
|
Release: 14
|
||||||
Group: Productivity/Networking/NFS
|
Group: Productivity/Networking/NFS
|
||||||
License: GPL v2 or later
|
License: GPL v2 or later
|
||||||
BuildRoot: %{_tmppath}/%{name}-%{version}-build
|
BuildRoot: %{_tmppath}/%{name}-%{version}-build
|
||||||
@ -267,6 +274,11 @@ rm -rf $RPM_BUILD_ROOT
|
|||||||
%doc nfs/*.html nfs/*.ps linux-nfs/* README.NFSv4
|
%doc nfs/*.html nfs/*.ps linux-nfs/* README.NFSv4
|
||||||
|
|
||||||
%changelog
|
%changelog
|
||||||
|
* Wed Aug 13 2008 werner@suse.de
|
||||||
|
- Fix boot script and use correct Stop tags
|
||||||
|
- The nfs boot script uses lazy umount and terminates process
|
||||||
|
on shutdown in case of causing busy mounts
|
||||||
|
- The nfs boot script may parse /etc/fstab only once
|
||||||
* Wed Jul 23 2008 hare@suse.de
|
* Wed Jul 23 2008 hare@suse.de
|
||||||
- Include mkinitrd scriptlets.
|
- Include mkinitrd scriptlets.
|
||||||
- Do not install Makefiles for nfs-doc.
|
- Do not install Makefiles for nfs-doc.
|
||||||
|
210
nfs.init
210
nfs.init
@ -1,9 +1,10 @@
|
|||||||
#! /bin/bash
|
#! /bin/bash
|
||||||
# Copyright (c) 1996-2002 SuSE Linux AG, Nuernberg, Germany.
|
# Copyright (c) 1996-2002 SuSE Linux AG, Nuernberg, Germany.
|
||||||
|
# Copyright (c) 2008 SuSE LINUX Products GmbH, Nuernberg, Germany.
|
||||||
# All rights reserved.
|
# All rights reserved.
|
||||||
#
|
#
|
||||||
# Author: Florian La Roche, 1996
|
# Author: Florian La Roche, 1996
|
||||||
# Werner Fink <werner@suse.de>, 1996
|
# Werner Fink <werner@suse.de>, 1996,2008
|
||||||
# Burchard Steinbild, 1996
|
# Burchard Steinbild, 1996
|
||||||
#
|
#
|
||||||
# Please send feedback to http://www.suse.de/feedback
|
# Please send feedback to http://www.suse.de/feedback
|
||||||
@ -13,9 +14,9 @@
|
|||||||
### BEGIN INIT INFO
|
### BEGIN INIT INFO
|
||||||
# Provides: nfs
|
# Provides: nfs
|
||||||
# Required-Start: $network $portmap
|
# Required-Start: $network $portmap
|
||||||
# Required-Stop:
|
# Required-Stop: $network $portmap
|
||||||
# Default-Start: 3 5
|
# Default-Start: 3 5
|
||||||
# Default-Stop:
|
# 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
|
||||||
@ -31,32 +32,48 @@ IDMAPD_SERVER_STATE=/var/lock/subsys/nfsserver-rpc.idmapd
|
|||||||
|
|
||||||
NEED_IDMAPD=no
|
NEED_IDMAPD=no
|
||||||
NEED_GSSD=no
|
NEED_GSSD=no
|
||||||
nfs=no
|
|
||||||
NEED_LDCONFIG=no
|
NEED_LDCONFIG=no
|
||||||
|
state=0
|
||||||
|
usr=""
|
||||||
|
opt=""
|
||||||
|
mnt=""
|
||||||
|
nfs=no
|
||||||
|
|
||||||
while read what where type options rest ; do
|
while read what where type options rest ; do
|
||||||
case "$what" in
|
case "$what" in
|
||||||
\#*|"") ;;
|
\#*|"") continue ;;
|
||||||
*) case "$options" in
|
esac
|
||||||
*noauto*) ;;
|
case ",$options," in
|
||||||
*) if test "$type" = "nfs" -o "$type" = "nfs4" ; then
|
*,noauto,*) continue ;;
|
||||||
nfs=yes
|
esac
|
||||||
case "$where" in
|
case "$type" in
|
||||||
/usr*|/opt*)
|
nfs|nfs4) ;;
|
||||||
NEED_LDCONFIG=yes
|
*) continue ;;
|
||||||
break
|
esac
|
||||||
;;
|
nfs=yes
|
||||||
*)
|
if test "$1" = status ; then
|
||||||
if grep -q "^$where" /etc/ld.so.conf; then
|
grep -qE "^$what[[:blank:]]+$where[[:blank:]]+nfs" /proc/mounts && continue
|
||||||
NEED_LDCONFIG=yes
|
state=3
|
||||||
break;
|
continue
|
||||||
fi
|
fi
|
||||||
;;
|
case "$where" in
|
||||||
esac
|
/usr*)
|
||||||
fi ;;
|
usr="${usr:+$usr }$where"
|
||||||
esac
|
NEED_LDCONFIG=yes
|
||||||
|
;;
|
||||||
|
/opt*)
|
||||||
|
opt="${opt:+$opt }$where"
|
||||||
|
NEED_LDCONFIG=yes
|
||||||
|
;;
|
||||||
|
*)
|
||||||
|
mnt="${mnt:+$mnt }$where"
|
||||||
|
test "$NEED_LDCONFIG" = yes && continue
|
||||||
|
grep -qE "^$where" /etc/ld.so.conf || continue
|
||||||
|
NEED_LDCONFIG=yes
|
||||||
|
;;
|
||||||
esac
|
esac
|
||||||
done < /etc/fstab
|
done < /etc/fstab
|
||||||
|
unset what where type options rest
|
||||||
|
|
||||||
case $NFS_SECURITY_GSS in
|
case $NFS_SECURITY_GSS in
|
||||||
[Nn]*) flavors="";;
|
[Nn]*) flavors="";;
|
||||||
@ -64,17 +81,17 @@ case $NFS_SECURITY_GSS in
|
|||||||
*) flavors="$NFS_SECURITY_GSS";;
|
*) flavors="$NFS_SECURITY_GSS";;
|
||||||
esac
|
esac
|
||||||
|
|
||||||
if [ "$flavors" ]; then
|
if test -n "$flavors" ; then
|
||||||
NEED_GSSD=yes
|
NEED_GSSD=yes
|
||||||
fi
|
fi
|
||||||
|
|
||||||
if [ "$NFS4_SUPPORT" = yes ]; then
|
if test "$NFS4_SUPPORT" = yes ; then
|
||||||
NEED_IDMAPD=yes
|
NEED_IDMAPD=yes
|
||||||
fi
|
fi
|
||||||
|
|
||||||
if [ -x /sbin/portmap ]; then
|
if test -x /sbin/portmap ; then
|
||||||
PORTMAP_BIN=/sbin/portmap
|
PORTMAP_BIN=/sbin/portmap
|
||||||
elif [ -x /sbin/rpcbind ]; then
|
elif test -x /sbin/rpcbind ; then
|
||||||
PORTMAP_BIN=/sbin/rpcbind
|
PORTMAP_BIN=/sbin/rpcbind
|
||||||
else
|
else
|
||||||
echo "portmap/rpcbind is missing"
|
echo "portmap/rpcbind is missing"
|
||||||
@ -83,41 +100,41 @@ else
|
|||||||
rc_exit
|
rc_exit
|
||||||
fi
|
fi
|
||||||
|
|
||||||
echo
|
|
||||||
mount_rpc_pipefs() {
|
mount_rpc_pipefs() {
|
||||||
# See if the file system is there yet
|
# See if the file system is there yet
|
||||||
case `stat -c "%t" -f /var/lib/nfs/rpc_pipefs` in
|
case `stat -c "%t" -f /var/lib/nfs/rpc_pipefs` in
|
||||||
*67596969*)
|
*67596969*)
|
||||||
return 0;;
|
return 0;;
|
||||||
esac
|
esac
|
||||||
|
|
||||||
mount -t rpc_pipefs rpc_pipefs /var/lib/nfs/rpc_pipefs
|
mount -t rpc_pipefs rpc_pipefs /var/lib/nfs/rpc_pipefs
|
||||||
}
|
}
|
||||||
|
|
||||||
mount_usr() {
|
mount_usr() {
|
||||||
while read what where type options rest ; do
|
test -n "$usr" -o -n "$opt" || return
|
||||||
case "$what" in
|
local where
|
||||||
\#*|"") ;;
|
for where in $usr $opt ; do
|
||||||
*) case "$options" in
|
mount -o nolock $where
|
||||||
*noauto*) ;;
|
done
|
||||||
*) if test "$type" = "nfs" -o "$type" = "nfs4" ; then
|
}
|
||||||
case "$where" in
|
|
||||||
/usr*)
|
close_usr() {
|
||||||
mount -o nolock $where
|
test -n "$usr" -o -n "$opt" -o -n "$mnt" || return
|
||||||
break
|
local -i proc=0
|
||||||
;;
|
local where
|
||||||
esac
|
for where in $usr $opt $mnt ; do
|
||||||
fi ;;
|
fuser -skm -TERM $where && let proc++
|
||||||
esac
|
done
|
||||||
esac
|
test $proc -eq 0 && return
|
||||||
done < /etc/fstab
|
sleep 5
|
||||||
|
for where in $usr $opt $mnt ; do
|
||||||
|
fuser -skm -KILL $where
|
||||||
|
done
|
||||||
}
|
}
|
||||||
|
|
||||||
do_start_gssd() {
|
do_start_gssd() {
|
||||||
for flavor in $flavors; do
|
for flavor in $flavors; do
|
||||||
/sbin/modprobe rpcsec_gss_$flavor
|
/sbin/modprobe rpcsec_gss_$flavor
|
||||||
done
|
done
|
||||||
|
|
||||||
mount_rpc_pipefs
|
mount_rpc_pipefs
|
||||||
startproc $GSSD_BIN
|
startproc $GSSD_BIN
|
||||||
return $?
|
return $?
|
||||||
@ -132,8 +149,8 @@ do_start_idmapd() {
|
|||||||
killproc -HUP $IDMAPD_BIN
|
killproc -HUP $IDMAPD_BIN
|
||||||
else
|
else
|
||||||
startproc $IDMAPD_BIN
|
startproc $IDMAPD_BIN
|
||||||
|
return $?
|
||||||
fi
|
fi
|
||||||
return $?
|
|
||||||
}
|
}
|
||||||
|
|
||||||
rc_reset
|
rc_reset
|
||||||
@ -141,27 +158,30 @@ case "$1" in
|
|||||||
start|reload)
|
start|reload)
|
||||||
echo -n "Starting NFS client services:"
|
echo -n "Starting NFS client services:"
|
||||||
if ! checkproc $PORTMAP_BIN ; then
|
if ! checkproc $PORTMAP_BIN ; then
|
||||||
echo "portmap/rpcbind is not running"
|
echo "portmap/rpcbind is not running"
|
||||||
rc_failed 3
|
rc_failed 3
|
||||||
rc_status -v
|
rc_status -v
|
||||||
rc_exit
|
rc_exit
|
||||||
fi
|
fi
|
||||||
|
|
||||||
# in case we need /usr via nfs
|
# in case we need /usr and/or /opt via nfs
|
||||||
mount_usr
|
mount_usr
|
||||||
|
|
||||||
# sm-notify
|
# sm-notify
|
||||||
echo -n " sm-notify"
|
echo -n " sm-notify"
|
||||||
/usr/sbin/sm-notify $SM_NOTIFY_OPTIONS
|
/usr/sbin/sm-notify $SM_NOTIFY_OPTIONS
|
||||||
# gssd
|
|
||||||
if [ "$NEED_GSSD" = yes ]; then
|
# start gssd
|
||||||
|
if test "$NEED_GSSD" = yes ; then
|
||||||
echo -n " gssd"
|
echo -n " gssd"
|
||||||
do_start_gssd || {
|
do_start_gssd || {
|
||||||
rc_status -v
|
rc_status -v
|
||||||
rc_exit
|
rc_exit
|
||||||
}
|
}
|
||||||
fi
|
fi
|
||||||
# idmapd
|
|
||||||
if [ "$NEED_IDMAPD" = yes ]; then
|
# start idmapd
|
||||||
|
if test "$NEED_IDMAPD" = yes ; then
|
||||||
echo -n " idmapd"
|
echo -n " idmapd"
|
||||||
do_start_idmapd || {
|
do_start_idmapd || {
|
||||||
rc_status -v
|
rc_status -v
|
||||||
@ -169,9 +189,9 @@ case "$1" in
|
|||||||
}
|
}
|
||||||
echo $IDMAPD_BIN > $IDMAPD_CLIENT_STATE
|
echo $IDMAPD_BIN > $IDMAPD_CLIENT_STATE
|
||||||
fi
|
fi
|
||||||
# statd is started when needed by mount.nfs
|
|
||||||
#
|
# remark: statd is started when needed by mount.nfs
|
||||||
if test "$nfs" = yes ; then
|
|
||||||
# Mount all auto NFS devices (-> nfs(5) and mount(8) )
|
# Mount all auto NFS devices (-> nfs(5) and mount(8) )
|
||||||
# NFS-Server sometime not reachable during boot phase.
|
# NFS-Server sometime not reachable during boot phase.
|
||||||
# It's sometime usefull to mount NFS devices in
|
# It's sometime usefull to mount NFS devices in
|
||||||
@ -181,44 +201,41 @@ case "$1" in
|
|||||||
# sleep 2 && mount -at nfs,nfs4 &
|
# sleep 2 && mount -at nfs,nfs4 &
|
||||||
# sleep 2
|
# sleep 2
|
||||||
#
|
#
|
||||||
# Note: Some people importing the /usr partition.
|
if test "$nfs" = yes ; then
|
||||||
# Therefore we do _NOT_ use an ampersand!
|
mount -at nfs,nfs4 > /dev/null 2>&1
|
||||||
#
|
fi
|
||||||
mount -at nfs,nfs4 > /dev/null 2>&1
|
|
||||||
#
|
#
|
||||||
# generate new list of available shared libraries
|
# generate new list of available shared libraries
|
||||||
#
|
#
|
||||||
if test "$NEED_LDCONFIG" = yes; then
|
if test "$NEED_LDCONFIG" = yes; then
|
||||||
rc_status
|
# check if ld.so.cache needs to be refreshed
|
||||||
sleep 1
|
/etc/init.d/boot.ldconfig start > /dev/null 2>&1
|
||||||
# check if ld.so.cache needs to be refreshed
|
|
||||||
/etc/init.d/boot.ldconfig start > /dev/null 2>&1
|
|
||||||
fi
|
|
||||||
fi
|
fi
|
||||||
#
|
#
|
||||||
rc_status -v
|
rc_status -v
|
||||||
;;
|
;;
|
||||||
stop)
|
stop)
|
||||||
echo -n "Shutting down NFS client services:"
|
echo -n "Shutting down NFS client services:"
|
||||||
if test "$nfs" = "yes" ; then
|
|
||||||
#
|
|
||||||
# Unmount in background because during long timeouts
|
|
||||||
#
|
|
||||||
umount -at nfs,nfs4 &
|
|
||||||
sleep 2
|
|
||||||
fi
|
|
||||||
#
|
#
|
||||||
if [ "$NEED_GSSD" = yes ]; then
|
# Unmount background because during long timeouts
|
||||||
|
#
|
||||||
|
if test "$nfs" = yes ; then
|
||||||
|
umount -alt nfs,nfs4 &
|
||||||
|
fi
|
||||||
|
|
||||||
|
# stop gssd
|
||||||
|
if test "$NEED_GSSD" = yes ; then
|
||||||
echo -n " gssd"
|
echo -n " gssd"
|
||||||
killproc $GSSD_BIN || {
|
killproc $GSSD_BIN || {
|
||||||
rc_status -v
|
rc_status -v
|
||||||
rc_exit
|
rc_exit
|
||||||
}
|
}
|
||||||
fi
|
fi
|
||||||
#
|
|
||||||
if [ "$NEED_IDMAPD" = yes ]; then
|
# stop idmapd
|
||||||
|
if test "$NEED_IDMAPD" = yes ; then
|
||||||
# only stop idmapd if it is not needed by server
|
# only stop idmapd if it is not needed by server
|
||||||
if [ ! -f $IDMAPD_SERVER_STATE ]; then
|
if test ! -f $IDMAPD_SERVER_STATE ; then
|
||||||
echo -n " idmapd"
|
echo -n " idmapd"
|
||||||
killproc $IDMAPD_BIN || {
|
killproc $IDMAPD_BIN || {
|
||||||
rc_status -v
|
rc_status -v
|
||||||
@ -227,6 +244,13 @@ case "$1" in
|
|||||||
fi
|
fi
|
||||||
rm -f $IDMAPD_CLIENT_STATE
|
rm -f $IDMAPD_CLIENT_STATE
|
||||||
fi
|
fi
|
||||||
|
|
||||||
|
# in case we have /usr and/or /opt via nfs terminate all
|
||||||
|
# processes on them (nfsservers shouldn't do /usr via nfs)
|
||||||
|
case "$RUNLEVEL" in
|
||||||
|
[016sS]) close_usr ;;
|
||||||
|
esac
|
||||||
|
|
||||||
#
|
#
|
||||||
rc_status -v
|
rc_status -v
|
||||||
;;
|
;;
|
||||||
@ -239,28 +263,18 @@ case "$1" in
|
|||||||
;;
|
;;
|
||||||
status)
|
status)
|
||||||
echo -n "Checking for mounted nfs shares (from /etc/fstab):"
|
echo -n "Checking for mounted nfs shares (from /etc/fstab):"
|
||||||
if test "$nfs" = "yes" ; then
|
if test "$nfs" = yes ; then
|
||||||
while read what where type options rest ; do
|
rc_failed $status
|
||||||
case "$what" in
|
|
||||||
\#*|"") ;;
|
|
||||||
*) case "$options" in
|
|
||||||
*noauto*) ;;
|
|
||||||
*) if test "$type" = "nfs" -o "$type" = "nfs4" ; then
|
|
||||||
grep -q "$what $where nfs" /proc/mounts || rc_failed 3
|
|
||||||
fi ;;
|
|
||||||
esac
|
|
||||||
esac
|
|
||||||
done < /etc/fstab
|
|
||||||
else
|
else
|
||||||
rc_failed 3
|
rc_failed 3
|
||||||
fi
|
fi
|
||||||
#
|
#
|
||||||
if [ "$NEED_GSSD" = yes ] && ! checkproc $GSSD_BIN; then
|
if test "$NEED_GSSD" = yes && ! checkproc $GSSD_BIN; then
|
||||||
echo "gssd not running"
|
echo "gssd not running"
|
||||||
rc_failed 3
|
rc_failed 3
|
||||||
fi
|
fi
|
||||||
#
|
#
|
||||||
if [ "$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
|
||||||
fi
|
fi
|
||||||
@ -271,7 +285,7 @@ case "$1" in
|
|||||||
;;
|
;;
|
||||||
try-restart|condrestart)
|
try-restart|condrestart)
|
||||||
$0 status
|
$0 status
|
||||||
if test $? = 0; then
|
if test $? -eq 0; then
|
||||||
$0 restart
|
$0 restart
|
||||||
else
|
else
|
||||||
rc_reset
|
rc_reset
|
||||||
|
@ -9,13 +9,13 @@
|
|||||||
# /etc/init.d/nfsserver
|
# /etc/init.d/nfsserver
|
||||||
#
|
#
|
||||||
### BEGIN INIT INFO
|
### BEGIN INIT INFO
|
||||||
# Provides: nfsserver
|
# Provides: nfsserver
|
||||||
# Required-Start: $network $named $portmap
|
# Required-Start: $network $named $portmap
|
||||||
# Required-Stop: $network $portmap
|
# Required-Stop: $network $portmap
|
||||||
# Should-Start: ypbind krb5kdc
|
# Should-Start: ypbind krb5kdc
|
||||||
# Should-Stop:
|
# Should-Stop: ypbind krb5kdc
|
||||||
# Default-Start: 3 5
|
# Default-Start: 3 5
|
||||||
# Default-Stop: 0 1 2 6
|
# Default-Stop: 0 1 2 6
|
||||||
# Short-Description: Start the kernel based NFS daemon
|
# Short-Description: Start the kernel based NFS daemon
|
||||||
### END INIT INFO
|
### END INIT INFO
|
||||||
|
|
||||||
@ -149,8 +149,8 @@ do_start_idmapd() {
|
|||||||
killproc -HUP $IDMAPD_BIN
|
killproc -HUP $IDMAPD_BIN
|
||||||
else
|
else
|
||||||
startproc $IDMAPD_BIN
|
startproc $IDMAPD_BIN
|
||||||
|
return $?
|
||||||
fi
|
fi
|
||||||
return $?
|
|
||||||
}
|
}
|
||||||
|
|
||||||
case "$1" in
|
case "$1" in
|
||||||
|
Loading…
x
Reference in New Issue
Block a user