diff --git a/nfs-utils-1.0.7-bind-syntax.patch b/nfs-utils-1.0.7-bind-syntax.patch new file mode 100644 index 0000000..3342282 --- /dev/null +++ b/nfs-utils-1.0.7-bind-syntax.patch @@ -0,0 +1,23 @@ + support/export/export.c | 2 + support/include/misc.h | 3 + support/include/nfslib.h | 1 + support/misc/mountpoint.c | 158 +++++++++++++++++++++++++++++++++++++++++++++- + support/nfs/exports.c | 7 ++ + utils/mountd/cache.c | 11 +-- + utils/mountd/mountd.c | 7 +- + utils/mountd/mountd.h | 9 ++ + 8 files changed, 187 insertions(+), 11 deletions(-) + +Index: nfs-utils-1.0.7/support/nfs/exports.c +=================================================================== +--- nfs-utils-1.0.7.orig/support/nfs/exports.c ++++ nfs-utils-1.0.7/support/nfs/exports.c +@@ -435,6 +435,8 @@ bad_option: + ep->e_mountpoint = strdup(mp+1); + else + ep->e_mountpoint = strdup(""); ++ } else if (strncmp(opt, "bind=/", 6) == 0) { ++ /* ignore this for now */ + } else { + xlog(L_ERROR, "%s:%d: unknown keyword \"%s\"\n", + flname, flline, opt); diff --git a/nfs-utils.changes b/nfs-utils.changes index 57c40bc..01cb0ec 100644 --- a/nfs-utils.changes +++ b/nfs-utils.changes @@ -1,3 +1,9 @@ +------------------------------------------------------------------- +Mon Jan 8 18:23:44 CET 2007 - ro@suse.de + +- move srvinfo.d to svcinfo.d (typo in fate entry) +- Added handling for NFSv4 bind mounts in init script (#229583) + ------------------------------------------------------------------- Mon Dec 18 18:40:03 CET 2006 - ro@suse.de diff --git a/nfs-utils.spec b/nfs-utils.spec index e7ab055..08e7edd 100644 --- a/nfs-utils.spec +++ b/nfs-utils.spec @@ -1,7 +1,7 @@ # # spec file for package nfs-utils (Version 1.0.10) # -# Copyright (c) 2006 SUSE LINUX Products GmbH, Nuernberg, Germany. +# Copyright (c) 2007 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. # @@ -15,7 +15,7 @@ BuildRequires: gcc-c++ krb5-devel libevent librpcsecgss nfsidmap openldap2-deve URL: http://nfs.sourceforge.net Summary: Support Utilities for Kernel nfsd Version: 1.0.10 -Release: 25 +Release: 29 Group: Productivity/Networking/NFS Obsoletes: knfsd linuxnfs nfsutils Provides: knfsd linuxnfs nfsutils @@ -40,6 +40,7 @@ Patch3: nfs-utils-anon-uid32.patch Patch4: nfs-utils-noroot.patch Patch5: nfs-utils-gssd-select-ccache.patch Patch6: nfs-utils-krb5.patch +Patch7: nfs-utils-1.0.7-bind-syntax.patch %description This package contains the NFS utilities. You can tune the number of @@ -61,6 +62,7 @@ Authors: %patch4 %patch5 -p1 %patch6 +%patch7 -p1 %build %{?suse_update_config:%{suse_update_config -f }} @@ -191,6 +193,9 @@ rm -rf $RPM_BUILD_ROOT %{_mandir}/man8/rpcdebug.8.gz %changelog -n nfs-utils +* Mon Jan 08 2007 - ro@suse.de +- move srvinfo.d to svcinfo.d (typo in fate entry) +- Added handling for NFSv4 bind mounts in init script (#229583) * Mon Dec 18 2006 - ro@suse.de - added nfsserver.xml to /etc/omc/srvinfo.d (fate#301835) * Tue Aug 08 2006 - ro@suse.de diff --git a/nfsserver.init b/nfsserver.init index a313ea4..c82bcaf 100644 --- a/nfsserver.init +++ b/nfsserver.init @@ -63,6 +63,32 @@ check_for_nfsdfs() { done < /proc/filesystems } +nfs4_bind_mounts() { + + # In case of doubt, try "man sed" :-) + cat /etc/exports | + sed ':-0;s/\\$//;T;N;s/\n[[:space:]]*/ /;b-0' | + sed 's/^\([^[:space:]]*\).*bind=\([^,)]*\).*/\1 \2/;t;d' | + sort | + while read export dir; do + test -d $export || mkdir -p $export + # Fortunately, mount ignores unknown + # options, so we have an easy way to + # tag our "magic" bind mounts + mount -o bind,nfsexp $dir $export + done +} + +nfs4_unbind_mounts() { + + cat /etc/mtab | + grep '\' | + sort -r -k2 | + while read src mountpoint crap; do + umount $mountpoint + done +} + case "$1" in start) PARAMS=3 @@ -76,10 +102,11 @@ case "$1" in rc_status fi if [ "$NFS4_SUPPORT" = "yes" ]; then - echo "+2 +3 +4" > /proc/fs/nfsd/versions + echo "+2 +3 +4" > /proc/fs/nfsd/versions else - echo "+2 +3 -4" > /proc/fs/nfsd/versions + echo "+2 +3 -4" > /proc/fs/nfsd/versions fi + nfs4_bind_mounts /usr/sbin/exportfs -r rc_status /usr/sbin/rpc.nfsd $PARAMS @@ -109,6 +136,7 @@ case "$1" in umount /proc/fs/nfsd rc_status fi + nfs4_unbind_mounts rc_status -v ;; try-restart) @@ -130,6 +158,8 @@ case "$1" in ;; reload|force-reload) echo -n "Reload kernel based NFS server" + # Unfortunately, there's no sane way of doing this: + nfs4_unbind_mounts; nfs4_bind_mounts /usr/sbin/exportfs -r rc_status -v ;;