- nfsserver.init: Don't depend on "mount" preserving

unknown options - it doesn't any more.  This can
  confuse nfsd_unbind_mounts (bnc#754805)

OBS-URL: https://build.opensuse.org/package/show/Base:System/nfs-utils?expand=0&rev=70
This commit is contained in:
Neil Brown 2012-05-02 01:36:09 +00:00 committed by Git OBS Bridge
parent d39c583080
commit 4195795a21
3 changed files with 33 additions and 23 deletions

View File

@ -1,3 +1,10 @@
-------------------------------------------------------------------
Wed May 2 01:34:51 UTC 2012 - nfbrown@suse.com
- nfsserver.init: Don't depend on "mount" preserving
unknown options - it doesn't any more. This can
confuse nfsd_unbind_mounts (bnc#754805)
-------------------------------------------------------------------
Sun Nov 20 06:47:14 UTC 2011 - coolo@suse.com

View File

@ -1,7 +1,7 @@
#
# spec file for package nfs-utils
#
# Copyright (c) 2011 SUSE LINUX Products GmbH, Nuernberg, Germany.
# Copyright (c) 2012 SUSE LINUX Products GmbH, Nuernberg, Germany.
#
# All modifications and additions to the file contributed by third parties
# remain the property of their copyright owners, unless otherwise agreed
@ -16,11 +16,19 @@
#
Name: nfs-utils
BuildRequires: e2fsprogs-devel gcc-c++ krb5-devel libgssglue-devel >= 0.3 librpcsecgss libtirpc-devel libtool nfsidmap-devel >= 0.24 pkgconfig tcpd-devel
BuildRequires: device-mapper-devel
BuildRequires: e2fsprogs-devel
BuildRequires: gcc-c++
BuildRequires: krb5-devel
BuildRequires: libgssglue-devel >= 0.3
BuildRequires: libmount-devel
BuildRequires: librpcsecgss
BuildRequires: libtirpc-devel
BuildRequires: libtool
BuildRequires: nfsidmap-devel >= 0.24
BuildRequires: pkgconfig
BuildRequires: tcpd-devel
%if 0%{?suse_version} > 1100
BuildRequires: libevent-devel
%else
@ -28,13 +36,12 @@ BuildRequires: libevent
%endif
Url: http://nfs.sourceforge.net
Summary: Support Utilities for Kernel nfsd
Version: 1.2.5
Release: 1
Group: Productivity/Networking/NFS
License: GPL-2.0+
Group: Productivity/Networking/NFS
Version: 1.2.5
Release: 0
BuildRoot: %{_tmppath}/%{name}-%{version}-build
PreReq: %fillup_prereq %insserv_prereq
AutoReqProv: on
BuildRoot: %{_tmppath}/%{name}-%{version}-build
Source0: http://downloads.sourceforge.net/project/nfs/nfs-utils/%{version}/nfs-utils-%{version}.tar.bz2
# Download does not work:
@ -70,9 +77,8 @@ Authors:
H.J. Lu <hjl@valinux.com>
%package -n nfs-client
License: GPL-2.0+
Group: Productivity/Networking/NFS
Summary: Support Utilities for NFS
Group: Productivity/Networking/NFS
Obsoletes: nfs-utils < 1.1.0
Requires: rpcbind
PreReq: %fillup_prereq %insserv_prereq
@ -91,13 +97,13 @@ Authors:
H.J. Lu <hjl@valinux.com>
%package -n nfs-kernel-server
License: GPL-2.0+
Group: Productivity/Networking/NFS
Summary: Support Utilities for Kernel nfsd
Group: Productivity/Networking/NFS
Provides: nfs-utils = %{version}
Obsoletes: nfs-utils < 1.1.0
Conflicts: nfs-server
Requires: nfs-client = %{version} rpcbind
Requires: nfs-client = %{version}
Requires: rpcbind
PreReq: %fillup_prereq %insserv_prereq
%description -n nfs-kernel-server
@ -114,9 +120,8 @@ Authors:
H.J. Lu <hjl@valinux.com>
%package -n nfs-doc
License: GPL-2.0+
Group: Productivity/Networking/NFS
Summary: Support Utilities for NFS
Group: Productivity/Networking/NFS
Obsoletes: nfs-utils < 1.1.0
Requires: latex2html-pngicons

View File

@ -57,6 +57,7 @@ NFSD_BIN=/usr/sbin/rpc.nfsd
IDMAPD_CLIENT_STATE=/var/run/nfs/nfs-rpc.idmapd
IDMAPD_SERVER_STATE=/var/run/nfs/nfsserver-rpc.idmapd
NFSD_BIND_MOUNTS=/var/run/nfs/bind.mounts
NEED_SVCGSSD=no
NEED_IDMPAPD=no
@ -93,6 +94,7 @@ check_for_nfsdfs() {
}
nfs4_bind_mounts() {
[ -d /var/run/nfs ] || mkdir /var/run/nfs
# In case of doubt, try "man sed" :-)
cat /etc/exports |
@ -101,21 +103,17 @@ nfs4_bind_mounts() {
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
mount -o bind "$dir" "$export"
echo "$dir" "$export"
done > $NFSD_BIND_MOUNTS
}
nfs4_unbind_mounts() {
cat /etc/mtab |
grep '\<nfsexp\>' |
sort -r -k2 |
sort -r -k2 $NFSD_BIND_MOUNTS |
while read src mountpoint crap; do
umount -l "$mountpoint"
done
> $NFSD_BIND_MOUNTS
}
mount_rpc_pipefs() {