This commit is contained in:
parent
c3304deef5
commit
6b5d1a1645
34
fork-start-statd.patch
Normal file
34
fork-start-statd.patch
Normal file
@ -0,0 +1,34 @@
|
|||||||
|
Index: nfs-utils-1.1.3/utils/mount/network.c
|
||||||
|
===================================================================
|
||||||
|
--- nfs-utils-1.1.3.orig/utils/mount/network.c
|
||||||
|
+++ nfs-utils-1.1.3/utils/mount/network.c
|
||||||
|
@@ -694,7 +694,18 @@ int start_statd(void)
|
||||||
|
#ifdef START_STATD
|
||||||
|
if (stat(START_STATD, &stb) == 0) {
|
||||||
|
if (S_ISREG(stb.st_mode) && (stb.st_mode & S_IXUSR)) {
|
||||||
|
- system(START_STATD);
|
||||||
|
+ pid_t pid = fork();
|
||||||
|
+ switch (pid) {
|
||||||
|
+ case 0: /* child */
|
||||||
|
+ execl(START_STATD, START_STATD, NULL);
|
||||||
|
+ exit(1);
|
||||||
|
+ case -1: /* error */
|
||||||
|
+ perror("Fork failed");
|
||||||
|
+ break;
|
||||||
|
+ default: /* parent */
|
||||||
|
+ waitpid(pid, NULL,0);
|
||||||
|
+ break;
|
||||||
|
+ }
|
||||||
|
if (probe_statd())
|
||||||
|
return 1;
|
||||||
|
}
|
||||||
|
Index: nfs-utils-1.1.3/utils/statd/start-statd
|
||||||
|
===================================================================
|
||||||
|
--- nfs-utils-1.1.3.orig/utils/statd/start-statd
|
||||||
|
+++ nfs-utils-1.1.3/utils/statd/start-statd
|
||||||
|
@@ -1,4 +1,4 @@
|
||||||
|
-#!/bin/sh
|
||||||
|
+#!/bin/sh -p
|
||||||
|
# nfsmount calls this script when mounting a filesystem with locking
|
||||||
|
# enabled, but when statd does not seem to be running (based on
|
||||||
|
# /var/run/rpc.statd.pid).
|
@ -1,3 +1,25 @@
|
|||||||
|
-------------------------------------------------------------------
|
||||||
|
Tue Nov 25 06:10:31 CET 2008 - nfbrown@suse.de
|
||||||
|
|
||||||
|
- nfs.init
|
||||||
|
* Don't 'stop' if root is on NFS.
|
||||||
|
If we stop NFS if root is on NFS, then
|
||||||
|
reboot will hang - bnc#439974
|
||||||
|
|
||||||
|
-------------------------------------------------------------------
|
||||||
|
Mon Nov 24 00:01:51 CET 2008 - nfbrown@suse.de
|
||||||
|
|
||||||
|
- nfs.init
|
||||||
|
* Don't try to kill processes with fuser.
|
||||||
|
it hangs when netowrk is down, and isn't
|
||||||
|
needed as we use lazy unmount
|
||||||
|
bnc#445908
|
||||||
|
* Don't kill statd if nfsd is still running.
|
||||||
|
- fork-start-statd.patch
|
||||||
|
* Don't use 'system' to run start-statd
|
||||||
|
as this looses our setuid bit.
|
||||||
|
bnc#447812
|
||||||
|
|
||||||
-------------------------------------------------------------------
|
-------------------------------------------------------------------
|
||||||
Fri Nov 21 11:45:58 CET 2008 - hare@suse.de
|
Fri Nov 21 11:45:58 CET 2008 - hare@suse.de
|
||||||
|
|
||||||
|
@ -27,7 +27,7 @@ BuildRequires: libevent
|
|||||||
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.3
|
Version: 1.1.3
|
||||||
Release: 12
|
Release: 13
|
||||||
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
|
||||||
@ -51,6 +51,7 @@ Patch1: nfs-utils-1.1.2-try-before-mount.patch
|
|||||||
Patch2: nfs-utils-1.1.2-connect-UDP.patch
|
Patch2: nfs-utils-1.1.2-connect-UDP.patch
|
||||||
Patch3: sm-notify-no-sync.patch
|
Patch3: sm-notify-no-sync.patch
|
||||||
Patch4: rpc.gssd-catch-signal.patch
|
Patch4: rpc.gssd-catch-signal.patch
|
||||||
|
Patch5: fork-start-statd.patch
|
||||||
|
|
||||||
%description
|
%description
|
||||||
This package contains the NFS utilities. You can tune the number of
|
This package contains the NFS utilities. You can tune the number of
|
||||||
@ -132,6 +133,7 @@ Authors:
|
|||||||
%patch2 -p1
|
%patch2 -p1
|
||||||
%patch3 -p1
|
%patch3 -p1
|
||||||
%patch4 -p1
|
%patch4 -p1
|
||||||
|
%patch5 -p1
|
||||||
cp %{S:6} .
|
cp %{S:6} .
|
||||||
|
|
||||||
%build
|
%build
|
||||||
@ -290,6 +292,22 @@ 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
|
||||||
|
* Tue Nov 25 2008 nfbrown@suse.de
|
||||||
|
- nfs.init
|
||||||
|
* Don't 'stop' if root is on NFS.
|
||||||
|
If we stop NFS if root is on NFS, then
|
||||||
|
reboot will hang - bnc#439974
|
||||||
|
* Mon Nov 24 2008 nfbrown@suse.de
|
||||||
|
- nfs.init
|
||||||
|
* Don't try to kill processes with fuser.
|
||||||
|
it hangs when netowrk is down, and isn't
|
||||||
|
needed as we use lazy unmount
|
||||||
|
bnc#445908
|
||||||
|
* Don't kill statd if nfsd is still running.
|
||||||
|
- fork-start-statd.patch
|
||||||
|
* Don't use 'system' to run start-statd
|
||||||
|
as this looses our setuid bit.
|
||||||
|
bnc#447812
|
||||||
* Fri Nov 21 2008 hare@suse.de
|
* Fri Nov 21 2008 hare@suse.de
|
||||||
- export ROOTFS_FSCK=0 to skip fsck for root on NFS (bnc#441234)
|
- export ROOTFS_FSCK=0 to skip fsck for root on NFS (bnc#441234)
|
||||||
* Thu Nov 20 2008 nfbrown@suse.de
|
* Thu Nov 20 2008 nfbrown@suse.de
|
||||||
|
36
nfs.init
36
nfs.init
@ -131,20 +131,6 @@ mount_usr() {
|
|||||||
done
|
done
|
||||||
}
|
}
|
||||||
|
|
||||||
close_usr() {
|
|
||||||
test -n "$usr" -o -n "$opt" -o -n "$mnt" || return
|
|
||||||
local -i proc=0
|
|
||||||
local where
|
|
||||||
for where in $usr $opt $mnt ; do
|
|
||||||
fuser -skm -TERM $where && let proc++
|
|
||||||
done
|
|
||||||
test $proc -eq 0 && return
|
|
||||||
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
|
||||||
@ -244,17 +230,16 @@ case "$1-$nfs" in
|
|||||||
stop-yes)
|
stop-yes)
|
||||||
echo -n "Shutting down NFS client services:"
|
echo -n "Shutting down NFS client services:"
|
||||||
|
|
||||||
# in case we have /usr and/or /opt via nfs terminate all
|
rootfs=`awk '$2 == "/" && $1 != "rootfs" {print $3}' /proc/mounts`
|
||||||
# processes on them (nfsservers shouldn't do /usr via nfs)
|
|
||||||
case "$RUNLEVEL" in
|
if test x$rootfs = xnfs ; then
|
||||||
[016sS]) close_usr ;;
|
echo -n " root filesystem is on NFS"
|
||||||
esac
|
rc_status -s
|
||||||
|
else
|
||||||
|
|
||||||
|
|
||||||
#
|
|
||||||
# Unmount background because during long timeouts
|
|
||||||
#
|
|
||||||
if test "$nfs" = yes ; then
|
if test "$nfs" = yes ; then
|
||||||
umount -alt nfs,nfs4 &
|
umount -alt nfs,nfs4
|
||||||
fi
|
fi
|
||||||
|
|
||||||
# stop gssd
|
# stop gssd
|
||||||
@ -273,16 +258,19 @@ case "$1-$nfs" in
|
|||||||
rm -f $IDMAPD_CLIENT_STATE
|
rm -f $IDMAPD_CLIENT_STATE
|
||||||
fi
|
fi
|
||||||
|
|
||||||
# stop rpc.statd
|
# stop rpc.statd if not needed by server
|
||||||
if checkproc $STATD_BIN ; then
|
if checkproc $STATD_BIN ; then
|
||||||
|
if [ `cat /proc/fs/nfsd/threads 2> /dev/null`0 -eq 0 ]; then
|
||||||
echo -n " rpc.statd"
|
echo -n " rpc.statd"
|
||||||
killproc $STATD_BIN
|
killproc $STATD_BIN
|
||||||
fi
|
fi
|
||||||
|
fi
|
||||||
|
|
||||||
umount_rpc_pipefs
|
umount_rpc_pipefs
|
||||||
|
|
||||||
#
|
#
|
||||||
rc_status -v
|
rc_status -v
|
||||||
|
fi
|
||||||
;;
|
;;
|
||||||
restart*|force-reload*)
|
restart*|force-reload*)
|
||||||
## Stop the service and regardless of whether it was
|
## Stop the service and regardless of whether it was
|
||||||
|
Loading…
Reference in New Issue
Block a user