diff --git a/0001-Fix-protocol-minor-version-fall-back.patch b/0001-Fix-protocol-minor-version-fall-back.patch deleted file mode 100644 index d2f4b83..0000000 --- a/0001-Fix-protocol-minor-version-fall-back.patch +++ /dev/null @@ -1,49 +0,0 @@ -From 78bb645a42c216b37b8d930c7c849a3fa89babf8 Mon Sep 17 00:00:00 2001 -From: Takashi Iwai -Date: Sat, 16 Jan 2016 12:02:30 -0500 -Subject: [PATCH] Fix protocol minor version fall-back - -mount.nfs currently expects mount(2) to fail with EPROTONOSUPPORT if -the kernel doesn't understand the requested NFS version. - -Unfortunately if the requested minor is not known to the kernel -it returns -EINVAL. -In kernels since 3.11 this can happen in nfs4_alloc_client(), if -compiled without NFS_V4_2. - -More generally it can happen in in nfs_validate_text_mount_data() -when nfs_parse_mount_options() returns 0 because -nfs_parse_version_string() -didn't recognise the version. - -EPROTONOSUPPORT is only returned if NFSv4 support is completely compiled -out. - -So nfs_autonegotiate needs to check for EINVAL as well as -EPROTONOSUPPORT. - -URL: https://bugzilla.opensuse.org/show_bug.cgi?id=959211 -Reported-by: Takashi Iwai -Signed-off-by: NeilBrown -Signed-off-by: Steve Dickson ---- - utils/mount/stropts.c | 3 +++ - 1 file changed, 3 insertions(+) - -diff --git a/utils/mount/stropts.c b/utils/mount/stropts.c -index c8f5a6d223e7..86829a902bfd 100644 ---- a/utils/mount/stropts.c -+++ b/utils/mount/stropts.c -@@ -841,6 +841,9 @@ check_result: - case EPROTONOSUPPORT: - /* A clear indication that the server or our - * client does not support NFS version 4 and minor */ -+ case EINVAL: -+ /* A less clear indication that our client -+ * does not support NFSv4 minor version. */ - if (mi->version.v_mode == V_GENERAL && - mi->version.minor == 0) - return result; --- -2.7.1 - diff --git a/0001-close-the-syslog-fd-in-daemon_init.patch b/0001-close-the-syslog-fd-in-daemon_init.patch deleted file mode 100644 index 75edadc..0000000 --- a/0001-close-the-syslog-fd-in-daemon_init.patch +++ /dev/null @@ -1,41 +0,0 @@ -From 273b46473594b8aa4e55f682577d1dd94d44ad50 Mon Sep 17 00:00:00 2001 -From: Scott Mayhew -Date: Mon, 2 Nov 2015 08:07:11 -0500 -Subject: [PATCH] close the syslog fd in daemon_init() - -Commit 7addf9d (cleanup daemonization code) added the following line to -mydaemon_init(): - - dup2(pipefds[1], 3); - -If we've already called vsyslog() before the fork(), then chances are fd -3 was being used for the syslog socket. In that case the next vsyslog() -call will cause the data to appear on the read end of the pipe, causing -the parent to exit with a nonzero status. If systemd is running, it -will see the parent's nonzero exit status and will terminate the child -as well. - -So just call closelog() to close the fd. The next call to vsyslog() -will open a new one if need be. - -Signed-off-by: Scott Mayhew -Signed-off-by: Steve Dickson ---- - support/nfs/mydaemon.c | 1 + - 1 file changed, 1 insertion(+) - -diff --git a/support/nfs/mydaemon.c b/support/nfs/mydaemon.c -index 3391eff39008..701cfd914179 100644 ---- a/support/nfs/mydaemon.c -+++ b/support/nfs/mydaemon.c -@@ -122,6 +122,7 @@ daemon_init(bool fg) - dup2(tempfd, 0); - dup2(tempfd, 1); - dup2(tempfd, 2); -+ closelog(); - dup2(pipefds[1], 3); - pipefds[1] = 3; - closeall(4); --- -2.8.1 - diff --git a/0001-mount-run-START_STATD-fully-as-root.patch b/0001-mount-run-START_STATD-fully-as-root.patch deleted file mode 100644 index bb378bf..0000000 --- a/0001-mount-run-START_STATD-fully-as-root.patch +++ /dev/null @@ -1,52 +0,0 @@ -From 8714f14c1966612d073d922d86a394c424eda724 Mon Sep 17 00:00:00 2001 -From: NeilBrown -Date: Fri, 22 Apr 2016 09:13:31 +1000 -Subject: [PATCH] mount: run START_STATD fully as root - -If a "user" mount is the first NFSv3 mount, mount.nfs will be running -setuid to root (with non-root as the real-uid) when it executes START_STATD. - -start-statd is a shell script and many shells refuse to run setuid, -dropping privileges immediately. This results in start-statd running -as an unprivileged user and so statd fails to start. - -To fix this, call "setuid(0)" to set real uid to zero. Also call "setgid(0)" -for consistency. - -The behaviour of a shell can often be affected by the environment, -such as the "shell functions" that bash includes from the environment. -To avoid the user being able to pass such environment to the shell, -explicitly pass an empty environment. The start-statd script explicitly -sets the PATH which is all it really needs. - -Signed-off-by: NeilBrown ---- - utils/mount/network.c | 5 ++++- - 1 file changed, 4 insertions(+), 1 deletion(-) - -diff --git a/utils/mount/network.c b/utils/mount/network.c -index 7240ca7bcdc4..0d12613e86a4 100644 ---- a/utils/mount/network.c -+++ b/utils/mount/network.c -@@ -795,6 +795,7 @@ int start_statd(void) - if (S_ISREG(stb.st_mode) && (stb.st_mode & S_IXUSR)) { - int cnt = STATD_TIMEOUT * 10; - int status = 0; -+ char * const envp[1] = { NULL }; - const struct timespec ts = { - .tv_sec = 0, - .tv_nsec = 100000000, -@@ -802,7 +803,9 @@ int start_statd(void) - pid_t pid = fork(); - switch (pid) { - case 0: /* child */ -- execl(START_STATD, START_STATD, NULL); -+ setgid(0); -+ setuid(0); -+ execle(START_STATD, START_STATD, NULL, envp); - exit(1); - case -1: /* error */ - nfs_error(_("%s: fork failed: %s"), --- -2.8.1 - diff --git a/0001-mount.nfs-hide-EBUSY-errors.patch b/0001-mount.nfs-hide-EBUSY-errors.patch deleted file mode 100644 index 71193c2..0000000 --- a/0001-mount.nfs-hide-EBUSY-errors.patch +++ /dev/null @@ -1,48 +0,0 @@ -From f0dc907b52892c18ccad2e573850583c0ee01157 Mon Sep 17 00:00:00 2001 -From: NeilBrown -Date: Wed, 21 Oct 2015 14:07:52 +1100 -Subject: [PATCH] mount.nfs - hide EBUSY errors. - -Linux only returns EBUSY for a non-remount mount if the exact -requested filesystem is already mounted. Arguably this is not an -error. - -"mount -a" tries to see if each request filesystem is already mounted. -Sometimes it gets it wrong - e.g. hostname aliases can confuse it. -So "mount -a" will report a failure "already mounted", which is -wrong because it should filter those out. - -An easy fix it just to be silent about EBUSY. As the requested -result (a given filesystem being mounted at a given location) is in -effect after the EBUSY return, we can just treat it as success. - -This removed the confusing "already mounted" errors. - -Signed-off-by: NeilBrown ---- - utils/mount/stropts.c | 9 +++++++++ - 1 file changed, 9 insertions(+) - -diff --git a/utils/mount/stropts.c b/utils/mount/stropts.c -index 86829a902bfd..320dde2fab92 100644 ---- a/utils/mount/stropts.c -+++ b/utils/mount/stropts.c -@@ -960,6 +960,15 @@ static int nfsmount_fg(struct nfsmount_info *mi) - if (nfs_try_mount(mi)) - return EX_SUCCESS; - -+ if (errno == EBUSY) -+ /* The only cause of EBUSY is if exactly the desired -+ * filesystem is already mounted. That can arguably -+ * be seen as success. "mount -a" tries to optimise -+ * out this case but sometimes fails. Help it out -+ * by pretending everything is rosy -+ */ -+ return EX_SUCCESS; -+ - if (nfs_is_permanent_error(errno)) - break; - --- -2.7.2 - diff --git a/0001-mount.nfs-trust-the-exit-status-of-start_statd.patch b/0001-mount.nfs-trust-the-exit-status-of-start_statd.patch deleted file mode 100644 index 36bcefe..0000000 --- a/0001-mount.nfs-trust-the-exit-status-of-start_statd.patch +++ /dev/null @@ -1,63 +0,0 @@ -From 37cd45cb913403b9f3b0c2aaa705e06cd70cc1d7 Mon Sep 17 00:00:00 2001 -From: NeilBrown -Date: Sat, 16 Jan 2016 12:06:32 -0500 -Subject: [PATCH] mount.nfs: trust the exit status of "start_statd". - -If DNS service is particularly slow, nfs_probe_statd() can fail even -though rpc.statd is actually running. This happens because rpc.statd -is single threaded and could be waiting longer for DNS than -nfs_probe_statd() will wait for it. - -This causes problems when mount.nfs uses nfs_probe_statd() to see if -statd is running, as is needed for NFSv3. - -Currently in these circumstances there are two possible outcomes. -1/ if systemd is in use, it will be told to start rpc-statd, which - is already running so no change. - mount.nfs will try pinging rpc.statd a few more times and could - eventually give up and fail the mount. - While slow DNS may well result in slow service, it shouldn't cause - a mount attempt to fail. - -2/ if systemd is not in use, a new rpc.statd will be started. This - can (and has) lead to a large number of rpc.statd processes running - on the one machine. - -This patch addresses the first scenario. If START_STATD is run and -exits with a success status, mount.nfs assumes statd is running and -allows the mount to succeed. A separate patch will address the other -scenario. - -Signed-off-by: NeilBrown -Signed-off-by: Steve Dickson ---- - utils/mount/network.c | 6 +++++- - 1 file changed, 5 insertions(+), 1 deletion(-) - -diff --git a/utils/mount/network.c b/utils/mount/network.c -index 8a9bf1476d51..7240ca7bcdc4 100644 ---- a/utils/mount/network.c -+++ b/utils/mount/network.c -@@ -794,6 +794,7 @@ int start_statd(void) - if (stat(START_STATD, &stb) == 0) { - if (S_ISREG(stb.st_mode) && (stb.st_mode & S_IXUSR)) { - int cnt = STATD_TIMEOUT * 10; -+ int status = 0; - const struct timespec ts = { - .tv_sec = 0, - .tv_nsec = 100000000, -@@ -808,7 +809,10 @@ int start_statd(void) - progname, strerror(errno)); - break; - default: /* parent */ -- waitpid(pid, NULL,0); -+ if (waitpid(pid, &status,0) == pid && -+ status == 0) -+ /* assume it worked */ -+ return 1; - break; - } - while (1) { --- -2.8.1 - diff --git a/0001-systemd-Decouple-the-starting-and-stopping-of-rpcbin.patch b/0001-systemd-Decouple-the-starting-and-stopping-of-rpcbin.patch deleted file mode 100644 index 9035b0a..0000000 --- a/0001-systemd-Decouple-the-starting-and-stopping-of-rpcbin.patch +++ /dev/null @@ -1,49 +0,0 @@ -From 4fabfcd082069a16ea8769b9ea9344fc15011366 Mon Sep 17 00:00:00 2001 -From: Steve Dickson -Date: Mon, 9 Nov 2015 11:28:30 -0500 -Subject: [PATCH] systemd: Decouple the starting and stopping of - rpcbind/nfs-server - -Commit b98f2af15 introduced a regression that cause the -starting and stop of rpcbind and the nfs-server to -be depended on each other - -The starting of the NFS server should start rpcbind -but bring rpcbind down should not bring the NFS -server down. - -Signed-off-by: Steve Dickson ---- - systemd/nfs-server.service | 2 +- - systemd/rpc-statd.service | 2 +- - 2 files changed, 2 insertions(+), 2 deletions(-) - -diff --git a/systemd/nfs-server.service b/systemd/nfs-server.service -index 12b02f26f9ce..317e5d689767 100644 ---- a/systemd/nfs-server.service -+++ b/systemd/nfs-server.service -@@ -1,7 +1,7 @@ - [Unit] - Description=NFS server and services - DefaultDependencies=no --Requires= network.target proc-fs-nfsd.mount rpcbind.service -+Requires= network.target proc-fs-nfsd.mount rpcbind.target - Requires= nfs-mountd.service - Wants=rpc-statd.service nfs-idmapd.service - Wants=rpc-statd-notify.service -diff --git a/systemd/rpc-statd.service b/systemd/rpc-statd.service -index 14604d783ddf..f16ea425dc77 100644 ---- a/systemd/rpc-statd.service -+++ b/systemd/rpc-statd.service -@@ -3,7 +3,7 @@ Description=NFS status monitor for NFSv2/3 locking. - DefaultDependencies=no - Conflicts=umount.target - Requires=nss-lookup.target rpcbind.target --After=network.target nss-lookup.target rpcbind.target -+After=network.target nss-lookup.target rpcbind.service - - PartOf=nfs-utils.service - --- -2.8.2 - diff --git a/0002-systemd-unit-files-fix-up-dependencies-on-rpcbind.patch b/0002-systemd-unit-files-fix-up-dependencies-on-rpcbind.patch deleted file mode 100644 index f84d1fb..0000000 --- a/0002-systemd-unit-files-fix-up-dependencies-on-rpcbind.patch +++ /dev/null @@ -1,131 +0,0 @@ -From 91da135f243d6f87fcea8b8a3ce28a589917b0e4 Mon Sep 17 00:00:00 2001 -From: NeilBrown -Date: Mon, 2 May 2016 08:54:13 -0400 -Subject: [PATCH] systemd unit files: fix up dependencies on rpcbind. - -The dependencies on rpcbind have been changed a few times and I think -they are still wrong. So I'll go into some detail to justify this -change. - -Firstly: rpcbind.target rpcbind.socket or rpcbind.service? - -The systemd documentation talks about targets as "synchronization -points" and likens them to SysV init run levels. Run levels are about -ordering but not dependencies. - -The systemd.special man page describes rpcbind.target as intended -explicitly for ordering sysvinit scripts, with "After=" dependencies. - -So while I think it is valid to use rpcbind.target for ordering -(before/after) it shouldn't be used for dependencies (Wants/Requires). -The rpcbind.target file included in systemd does not "Require" the -actual service, so requiring rpcbind.target itself is pointless. - -I think we shouldn't use rpcbind.target at all. Leave it for sysvinit -synchronization. - -So: .socket or .service? - -I think nfs only needs the socket to be active. On first connection -the service will be started. But nfs does not need to wait for the -service to start, only the socket. So I think we should exclusively -use rpcbind.socket. - -Next: Wants or Requires. - -rpc.statd definitely Requires rpcbind. It needs to register to be -useful, and without rpcbind it cannot register. - -nfs-server does not necesarily require rpcbind. Specifically if -configured for NFSv4 only, nfs-server will work quite happily without -rpcbind. - -Someone with an NFSv4 only setup who wants rpcbind to not run can use - systemctl mask rpcbind.socket -to ensure it never runs. -So nfs-server should only "Wants: rpcbind.socket". -I think - Commit: 4fabfcd08206 ("systemd: Decouple the starting and stopping of -rpcbind/nfs-server") -should have changed "Requires" to "Wants" rather than "server" to -"target" -to fix the dependency problem. - -Finally: After? - -It only makes sense to declare an ordering relation as "After:" -something that will actually be started. If "foo.service" is not part -of the systemd transaction, then "After: foo.service" has no effect. -So having: - Requires: rpcbind.target - After: rpcbind.socket - -doesn't make much sense unless there is some relationship between -rpcbind.target and rpcbind.socket, and there is no general guarantee -of that (though what individual distros do, I don't know). -So the "After" should match the "Wants" or "Requires". - -It might make sense to - Requires: rpcbind.socket - After: rpcbind.target - -as it is reasonable to assume that rpcbind.target will be ordered with -rpcbind.socket, but as we can use rpcbind.socket explictly, that is -clearer. - -So my conclusion is that nfs-server should: - Wants: rpcbind.socket - After: rpcbind.socket - -and rpc-statd should - Requires: rpcbind.socket - After: rpcbind.socket - -which is what this patch puts into effect. - -Signed-off-by: NeilBrown -Signed-off-by: Steve Dickson ---- - systemd/nfs-server.service | 5 +++-- - systemd/rpc-statd.service | 4 ++-- - 2 files changed, 5 insertions(+), 4 deletions(-) - -diff --git a/systemd/nfs-server.service b/systemd/nfs-server.service -index 317e5d689767..2ccdc6344cd5 100644 ---- a/systemd/nfs-server.service -+++ b/systemd/nfs-server.service -@@ -1,13 +1,14 @@ - [Unit] - Description=NFS server and services - DefaultDependencies=no --Requires= network.target proc-fs-nfsd.mount rpcbind.target -+Requires= network.target proc-fs-nfsd.mount - Requires= nfs-mountd.service -+Wants=rpcbind.socket - Wants=rpc-statd.service nfs-idmapd.service - Wants=rpc-statd-notify.service - - After= local-fs.target --After= network.target proc-fs-nfsd.mount rpcbind.service nfs-mountd.service -+After= network.target proc-fs-nfsd.mount rpcbind.socket nfs-mountd.service - After= nfs-idmapd.service rpc-statd.service - Before= rpc-statd-notify.service - -diff --git a/systemd/rpc-statd.service b/systemd/rpc-statd.service -index f16ea425dc77..a02f5c41a424 100644 ---- a/systemd/rpc-statd.service -+++ b/systemd/rpc-statd.service -@@ -2,8 +2,8 @@ - Description=NFS status monitor for NFSv2/3 locking. - DefaultDependencies=no - Conflicts=umount.target --Requires=nss-lookup.target rpcbind.target --After=network.target nss-lookup.target rpcbind.service -+Requires=nss-lookup.target rpcbind.socket -+After=network.target nss-lookup.target rpcbind.socket - - PartOf=nfs-utils.service - --- -2.8.2 - diff --git a/nfs-kernel-server.xml b/nfs-kernel-server.xml deleted file mode 100644 index 90a7936..0000000 --- a/nfs-kernel-server.xml +++ /dev/null @@ -1,90 +0,0 @@ - - - - - - - NFS Server - - - - Network File Systems (NFS) Server - - - - - /usr/sbin/rcnfsserver start - - - /usr/sbin/rcnfsserver restart - - - /usr/sbin/rcnfsserver stop - - - /usr/sbin/rcnfsserver status - - - - nfsd - nfsd - - - - - network - named - portmap - - - - diff --git a/nfs-utils-1.3.3.tar.xz b/nfs-utils-1.3.3.tar.xz deleted file mode 100644 index bdaac06..0000000 --- a/nfs-utils-1.3.3.tar.xz +++ /dev/null @@ -1,3 +0,0 @@ -version https://git-lfs.github.com/spec/v1 -oid sha256:700d689c5622c87953c34102e5befafc4d3c811e676852238f0dd79c9c0c084d -size 588468 diff --git a/nfs-utils-1.3.4.tar.xz b/nfs-utils-1.3.4.tar.xz new file mode 100644 index 0000000..ede7b56 --- /dev/null +++ b/nfs-utils-1.3.4.tar.xz @@ -0,0 +1,3 @@ +version https://git-lfs.github.com/spec/v1 +oid sha256:b42a5bc0a8d80d04650030ceb9a11f08f4acfbcb1ee297f657fb94e339c45975 +size 602240 diff --git a/nfs-utils-no-svcgss.service b/nfs-utils-no-svcgss.service deleted file mode 100644 index eb2bb59..0000000 --- a/nfs-utils-no-svcgss.service +++ /dev/null @@ -1,19 +0,0 @@ -diff --git a/systemd/Makefile.am b/systemd/Makefile.am -index 0331926dcc03..03f96e93dccf 100644 ---- a/systemd/Makefile.am -+++ b/systemd/Makefile.am -@@ -28,9 +28,13 @@ endif - if CONFIG_GSS - unit_files += \ - auth-rpcgss-module.service \ -- rpc-gssd.service \ -+ rpc-gssd.service -+ -+if CONFIG_SVCGSS -+unit_files += \ - rpc-svcgssd.service - endif -+endif - - EXTRA_DIST = $(unit_files) - diff --git a/nfs-utils-uninit-mem.patch b/nfs-utils-uninit-mem.patch deleted file mode 100644 index af43bd6..0000000 --- a/nfs-utils-uninit-mem.patch +++ /dev/null @@ -1,16 +0,0 @@ -Index: nfs-utils-1.3.3/utils/mount/network.c -=================================================================== ---- nfs-utils-1.3.3.orig/utils/mount/network.c -+++ nfs-utils-1.3.3/utils/mount/network.c -@@ -1626,7 +1626,10 @@ int nfs_options2pmap(struct mount_option - return 0; - if (!nfs_nfs_version(options, &version)) - return 0; -- nfs_pmap->pm_vers = version.major; -+ if (version.v_mode == V_DEFAULT) -+ nfs_pmap->pm_vers = 0; -+ else -+ nfs_pmap->pm_vers = version.major; - if (!nfs_nfs_protocol(options, &nfs_pmap->pm_prot)) - return 0; - if (!nfs_nfs_port(options, &nfs_pmap->pm_port)) diff --git a/nfs-utils.changes b/nfs-utils.changes index 65d097b..4ff870d 100644 --- a/nfs-utils.changes +++ b/nfs-utils.changes @@ -1,3 +1,42 @@ +------------------------------------------------------------------- +Wed Aug 10 02:57:57 UTC 2016 - nfbrown@suse.com + +- nfs-utils-1.3.4.tar.xz + New upstream release. Lots of bugfixes, no significant + functionality changes + +- delete 0001-Fix-protocol-minor-version-fall-back.patch + delete 0001-close-the-syslog-fd-in-daemon_init.patch + delete 0001-mount-run-START_STATD-fully-as-root.patch + delete 0001-mount.nfs-hide-EBUSY-errors.patch + delete 0001-mount.nfs-trust-the-exit-status-of-start_statd.patch + delete 0001-systemd-Decouple-the-starting-and-stopping-of-rpcbin.patch + delete 0002-systemd-unit-files-fix-up-dependencies-on-rpcbind.patch + delete nfs-utils-no-svcgss.service + delete nfs-utils-uninit-mem.patch + All patches are included in 1.3.4 + + +------------------------------------------------------------------- +Tue Aug 9 23:32:10 UTC 2016 - nfbrown@suse.com + +- nfs-utils_env.sh + Fix some problems with version_params. + Various misspellings and remove the possiblity + that V4 is both disabled and enabled. + (bsc#990356) + +------------------------------------------------------------------- +Mon Aug 8 08:39:54 UTC 2016 - tchvatal@suse.com + +- Drop OMC svcinfo file, nowdays useless + +------------------------------------------------------------------- +Mon Aug 8 08:38:16 UTC 2016 - tchvatal@suse.com + +- Sort a bit with spec-cleaner to get uptodate spec +- Convert deps from regular devels to pkgconfig style + ------------------------------------------------------------------- Tue May 24 22:27:14 UTC 2016 - nfbrown@suse.com diff --git a/nfs-utils.spec b/nfs-utils.spec index 5269d83..1a31c67 100644 --- a/nfs-utils.spec +++ b/nfs-utils.spec @@ -17,36 +17,17 @@ Name: nfs-utils -BuildRequires: device-mapper-devel -BuildRequires: e2fsprogs-devel -BuildRequires: fedfs-utils-devel -BuildRequires: gcc-c++ -BuildRequires: krb5-devel -BuildRequires: libevent-devel -BuildRequires: libmount-devel -BuildRequires: libtirpc-devel -BuildRequires: libtool -BuildRequires: nfsidmap-devel >= 0.24 -BuildRequires: pkgconfig -BuildRequires: sqlite3-devel -BuildRequires: systemd-rpm-macros -BuildRequires: tcpd-devel -Url: http://kernel.org/pub/linux/utils/nfs-utils/ +Version: 1.3.4 +Release: 0 Summary: Support Utilities for Kernel nfsd License: GPL-2.0+ Group: Productivity/Networking/NFS -Version: 1.3.3 -Release: 0 -BuildRoot: %{_tmppath}/%{name}-%{version}-build -PreReq: %fillup_prereq -%{?systemd_requires} -BuildRoot: %{_tmppath}/%{name}-%{version}-build +Url: http://kernel.org/pub/linux/utils/nfs-utils/ Source0: http://kernel.org/pub/linux/utils/nfs-utils/%{version}/nfs-utils-%{version}.tar.xz # Download does not work: # Source1: ftp://nfs.sourceforge.net/pub/nfs/nfs.doc.tar.bz2 Source1: nfs.doc.tar.bz2 Source4: sysconfig.nfs -Source5: nfs-kernel-server.xml Source6: README.NFSv4 Source7: fw-client Source8: fw-server @@ -59,17 +40,24 @@ Source16: nfs.service Source17: nfs-server.nfsserver.conf Source18: nfs-client.nfs.conf Patch0: nfs-utils-1.0.7-bind-syntax.patch -Patch1: nfs-utils-no-svcgss.service -Patch2: nfs-utils-uninit-mem.patch -Patch3: 0001-Fix-protocol-minor-version-fall-back.patch -Patch4: 0001-mount.nfs-hide-EBUSY-errors.patch -Patch5: 0001-close-the-syslog-fd-in-daemon_init.patch -Patch6: 0001-mount.nfs-trust-the-exit-status-of-start_statd.patch -Patch7: 0001-mount-run-START_STATD-fully-as-root.patch -Patch8: 0001-systemd-Decouple-the-starting-and-stopping-of-rpcbin.patch -Patch9: 0002-systemd-unit-files-fix-up-dependencies-on-rpcbind.patch - +BuildRequires: e2fsprogs-devel +BuildRequires: fedfs-utils-devel +BuildRequires: gcc-c++ +BuildRequires: libtool +BuildRequires: pkgconfig +BuildRequires: systemd-rpm-macros +BuildRequires: tcpd-devel +BuildRequires: pkgconfig(devmapper) +BuildRequires: pkgconfig(kdb) +BuildRequires: pkgconfig(krb5) +BuildRequires: pkgconfig(libevent) +BuildRequires: pkgconfig(libnfsidmap) >= 0.24 +BuildRequires: pkgconfig(libtirpc) +BuildRequires: pkgconfig(mount) +BuildRequires: pkgconfig(sqlite3) Suggests: python-base +BuildRoot: %{_tmppath}/%{name}-%{version}-build +%{?systemd_requires} %description This package contains the NFS utilities. You can tune the number of @@ -79,12 +67,12 @@ quota over NFS support, install the quota package. %package -n nfs-client Summary: Support Utilities for NFS Group: Productivity/Networking/NFS -Obsoletes: nfs-utils < 1.1.0 Requires: keyutils Requires: netcfg Requires: rpcbind -PreReq: %fillup_prereq -PreReq: permissions +Requires(post): %fillup_prereq +Requires(pre): permissions +Obsoletes: nfs-utils < 1.1.0 %description -n nfs-client This package contains common NFS utilities which are needed for client @@ -93,13 +81,12 @@ and kernel based server. %package -n nfs-kernel-server Summary: Support Utilities for Kernel nfsd Group: Productivity/Networking/NFS -Provides: nfs-utils = %{version} -Obsoletes: nfs-utils < 1.1.0 -Conflicts: nfs-server Requires: netcfg Requires: nfs-client = %{version} Requires: rpcbind -PreReq: %fillup_prereq +Conflicts: nfs-server +Provides: nfs-utils = %{version} +Obsoletes: nfs-utils < 1.1.0 %description -n nfs-kernel-server This package contains support for the kernel based NFS server. You can @@ -110,32 +97,23 @@ package. %package -n nfs-doc Summary: Support Utilities for NFS Group: Productivity/Networking/NFS -Obsoletes: nfs-utils < 1.1.0 Requires: latex2html-pngicons +Obsoletes: nfs-utils < 1.1.0 %description -n nfs-doc This package contains additional NFS documentation. %prep -%setup -q -n nfs-utils-%{version} -a 1 +%setup -q -a 1 %patch0 -p1 -%patch1 -p1 -%patch2 -p1 -%patch3 -p1 -%patch4 -p1 -%patch5 -p1 -%patch6 -p1 -%patch7 -p1 -%patch8 -p1 -%patch9 -p1 -cp %{S:6} . +cp %{SOURCE6} . %build -rm -f configure; autoreconf -fi +autoreconf -fvi export CFLAGS="%{optflags} -fPIE" export LDFLAGS="-pie" -%{configure} \ +%configure \ --with-systemd \ --enable-nfsv4 \ --enable-gss \ @@ -145,72 +123,70 @@ export LDFLAGS="-pie" --enable-mount \ --enable-libmount-mount \ --enable-mountconfig -make +make %{?_smp_mflags} cd nfs for i in *.html ; do sed -i \ - -e "s@/usr/lib/latex2html/icons.png/next_motif.png@/usr/share/latex2html/icons/next.png@" \ - -e "s@/usr/lib/latex2html/icons.png/up_motif_gr.png@/usr/share/latex2html/icons/up.png@" \ - -e "s@/usr/lib/latex2html/icons.png/previous_motif_gr.png@/usr/share/latex2html/icons/prev.png@" \ + -e "s@%{_prefix}/lib/latex2html/icons.png/next_motif.png@%{_datadir}/latex2html/icons/next.png@" \ + -e "s@%{_prefix}/lib/latex2html/icons.png/up_motif_gr.png@%{_datadir}/latex2html/icons/up.png@" \ + -e "s@%{_prefix}/lib/latex2html/icons.png/previous_motif_gr.png@%{_datadir}/latex2html/icons/prev.png@" \ $i done %install -make install DESTDIR=$RPM_BUILD_ROOT -install -d $RPM_BUILD_ROOT/%{_unitdir} -install -m 644 %{S:15} $RPM_BUILD_ROOT%{_unitdir}/nfsserver.service -install -m 644 %{S:16} $RPM_BUILD_ROOT%{_unitdir}/nfs.service -install -d $RPM_BUILD_ROOT%{_unitdir}/nfs-server.service.d -install -m 644 %{S:17} $RPM_BUILD_ROOT%{_unitdir}/nfs-server.service.d/nfsserver.conf -install -d $RPM_BUILD_ROOT%{_unitdir}/nfs-client.target.d -install -m 644 %{S:18} $RPM_BUILD_ROOT%{_unitdir}/nfs-client.target.d/nfs.conf -install -d $RPM_BUILD_ROOT/usr/lib/systemd/scripts -install -m 755 %{S:14} $RPM_BUILD_ROOT/usr/lib/systemd/scripts/nfs-utils_env.sh -install -d $RPM_BUILD_ROOT%{_unitdir}/nfs-config.service.d -install -m 644 %{S:12} $RPM_BUILD_ROOT%{_unitdir}/nfs-config.service.d/restart.conf -ln -sf /usr/sbin/service $RPM_BUILD_ROOT/usr/sbin/rcnfsserver -ln -sf /usr/sbin/service $RPM_BUILD_ROOT/usr/sbin/rcnfs-server -ln -sf /usr/sbin/service $RPM_BUILD_ROOT/usr/sbin/rcnfs -ln -sf /usr/sbin/service $RPM_BUILD_ROOT/usr/sbin/rcnfs-client +make %{?_smp_mflags} DESTDIR=%{buildroot} install +install -d %{buildroot}/%{_unitdir} +install -m 644 %{SOURCE15} %{buildroot}%{_unitdir}/nfsserver.service +install -m 644 %{SOURCE16} %{buildroot}%{_unitdir}/nfs.service +install -d %{buildroot}%{_unitdir}/nfs-server.service.d +install -m 644 %{SOURCE17} %{buildroot}%{_unitdir}/nfs-server.service.d/nfsserver.conf +install -d %{buildroot}%{_unitdir}/nfs-client.target.d +install -m 644 %{SOURCE18} %{buildroot}%{_unitdir}/nfs-client.target.d/nfs.conf +install -d %{buildroot}%{_prefix}/lib/systemd/scripts +install -m 755 %{SOURCE14} %{buildroot}%{_prefix}/lib/systemd/scripts/nfs-utils_env.sh +install -d %{buildroot}%{_unitdir}/nfs-config.service.d +install -m 644 %{SOURCE12} %{buildroot}%{_unitdir}/nfs-config.service.d/restart.conf +ln -sf %{_sbindir}/service %{buildroot}%{_sbindir}/rcnfsserver +ln -sf %{_sbindir}/service %{buildroot}%{_sbindir}/rcnfs-server +ln -sf %{_sbindir}/service %{buildroot}%{_sbindir}/rcnfs +ln -sf %{_sbindir}/service %{buildroot}%{_sbindir}/rcnfs-client # sysconfig-data -mkdir -p $RPM_BUILD_ROOT/var/adm/fillup-templates -install -m 644 %{SOURCE4} $RPM_BUILD_ROOT/var/adm/fillup-templates +mkdir -p %{buildroot}%{_localstatedir}/adm/fillup-templates +install -m 644 %{SOURCE4} %{buildroot}%{_localstatedir}/adm/fillup-templates # idmapd setup -install -d $RPM_BUILD_ROOT/etc -install -m 644 %{S:11} $RPM_BUILD_ROOT/etc/idmapd.conf -mkdir -p -m 755 $RPM_BUILD_ROOT/var/lib/nfs/rpc_pipefs -mkdir -p -m 755 $RPM_BUILD_ROOT/var/lib/nfs/v4recovery -mkdir -p -m 755 $RPM_BUILD_ROOT/usr/share/omc/svcinfo.d -install -m 644 %{SOURCE5} $RPM_BUILD_ROOT/usr/share/omc/svcinfo.d +install -d %{buildroot}/etc +install -m 644 %{SOURCE11} %{buildroot}%{_sysconfdir}/idmapd.conf +mkdir -p -m 755 %{buildroot}%{_localstatedir}/lib/nfs/rpc_pipefs +mkdir -p -m 755 %{buildroot}%{_localstatedir}/lib/nfs/v4recovery # sm-notify state -mkdir -p -m 755 $RPM_BUILD_ROOT/var/lib/nfs/sm -mkdir -p -m 755 $RPM_BUILD_ROOT/var/lib/nfs/sm.bak -touch $RPM_BUILD_ROOT/var/lib/nfs/state -mkdir -p $RPM_BUILD_ROOT/etc/sysconfig/SuSEfirewall2.d/services -install -m 0644 %{SOURCE7} ${RPM_BUILD_ROOT}/etc/sysconfig/SuSEfirewall2.d/services/nfs-client -install -m 0644 %{SOURCE8} ${RPM_BUILD_ROOT}/etc/sysconfig/SuSEfirewall2.d/services/nfs-kernel-server -install -m 644 utils/mount/nfsmount.conf $RPM_BUILD_ROOT/etc/nfsmount.conf +mkdir -p -m 755 %{buildroot}%{_localstatedir}/lib/nfs/sm +mkdir -p -m 755 %{buildroot}%{_localstatedir}/lib/nfs/sm.bak +touch %{buildroot}%{_localstatedir}/lib/nfs/state +mkdir -p %{buildroot}%{_sysconfdir}/sysconfig/SuSEfirewall2.d/services +install -m 0644 %{SOURCE7} %{buildroot}%{_sysconfdir}/sysconfig/SuSEfirewall2.d/services/nfs-client +install -m 0644 %{SOURCE8} %{buildroot}%{_sysconfdir}/sysconfig/SuSEfirewall2.d/services/nfs-kernel-server +install -m 644 utils/mount/nfsmount.conf %{buildroot}%{_sysconfdir}/nfsmount.conf # # hack to avoid automatic python dependency -chmod 644 $RPM_BUILD_ROOT%{_sbindir}/{mountstats,nfsiostat} +chmod 644 %{buildroot}%{_sbindir}/{mountstats,nfsiostat} %pre -n nfs-client useradd -r -c 'NFS statd daemon' \ - -s /sbin/nologin -d /var/lib/nfs -g nogroup statd > /dev/null 2>&1 || : + -s /sbin/nologin -d %{_localstatedir}/lib/nfs -g nogroup statd > /dev/null 2>&1 || : %service_add_pre nfs %post -n nfs-client -chown statd:nogroup /var/lib/nfs +chown statd:nogroup %{_localstatedir}/lib/nfs for i in state sm sm.bak; do - chown -R statd /var/lib/nfs/$i > /dev/null 2>&1 || : + chown -R statd %{_localstatedir}/lib/nfs/$i > /dev/null 2>&1 || : done ### migrate from /var/lock/subsys [ -d /run/nfs ] || mkdir /run/nfs -if [ -f /var/lock/subsys/nfs-rpc.idmapd ]; then - mv /var/lock/subsys/nfs-rpc.idmapd /run/nfs +if [ -f %{_localstatedir}/lock/subsys/nfs-rpc.idmapd ]; then + mv %{_localstatedir}/lock/subsys/nfs-rpc.idmapd /run/nfs fi -if [ -f /var/lock/subsys/nfsserver-rpc.idmapd ]; then - mv /var/lock/subsys/nfsserver-rpc.idmapd /run/nfs +if [ -f %{_localstatedir}/lock/subsys/nfsserver-rpc.idmapd ]; then + mv %{_localstatedir}/lock/subsys/nfsserver-rpc.idmapd /run/nfs fi ### %{fillup_only -n nfs nfs} @@ -236,11 +212,11 @@ fi %post -n nfs-kernel-server ### migrate from /var/lock/subsys [ -d /run/nfs ] || mkdir /run/nfs -if [ -f /var/lock/subsys/nfs-rpc.idmapd ]; then - mv /var/lock/subsys/nfs-rpc.idmapd /run/nfs +if [ -f %{_localstatedir}/lock/subsys/nfs-rpc.idmapd ]; then + mv %{_localstatedir}/lock/subsys/nfs-rpc.idmapd /run/nfs fi -if [ -f /var/lock/subsys/nfsserver-rpc.idmapd ]; then - mv /var/lock/subsys/nfsserver-rpc.idmapd /run/nfs +if [ -f %{_localstatedir}/lock/subsys/nfsserver-rpc.idmapd ]; then + mv %{_localstatedir}/lock/subsys/nfsserver-rpc.idmapd /run/nfs fi ### %service_add_post nfsserver @@ -250,8 +226,8 @@ fi %files -n nfs-client %defattr(-,root,root) -%config /etc/idmapd.conf -%config /etc/nfsmount.conf +%config %{_sysconfdir}/idmapd.conf +%config %{_sysconfdir}/nfsmount.conf %verify(not mode) %attr(0755,root,root) /sbin/mount.nfs /sbin/mount.nfs4 /sbin/umount.nfs @@ -289,34 +265,34 @@ fi %{_unitdir}/nfs-config.service.d/restart.conf %dir %{_libexecdir}/systemd/scripts %{_libexecdir}/systemd/scripts/nfs-utils_env.sh -%{_mandir}/man5/nfsmount.conf.5.gz -%{_mandir}/man5/nfs.5.gz -%{_mandir}/man8/mount.nfs.8.gz -%{_mandir}/man8/nfsidmap.8.gz -%{_mandir}/man8/nfsstat.8.gz -%{_mandir}/man8/rpc.sm-notify.8.gz -%{_mandir}/man8/showmount.8.gz -%{_mandir}/man8/sm-notify.8.gz -%{_mandir}/man8/umount.nfs.8.gz -%{_mandir}/man8/rpc.gssd.8.gz -%{_mandir}/man8/rpc.idmapd.8.gz -%{_mandir}/man8/gssd.8.gz -%{_mandir}/man8/idmapd.8.gz -%{_mandir}/man8/svcgssd.8.gz -%{_mandir}/man8/rpc.statd.8.gz -%{_mandir}/man8/rpcdebug.8.gz -%{_mandir}/man8/statd.8.gz -%{_mandir}/man8/mountstats.8.gz -%{_mandir}/man8/nfsiostat.8.gz -%{_mandir}/man8/blkmapd.8.gz -/var/adm/fillup-templates/sysconfig.nfs -%attr(0711,statd,nogroup) %dir /var/lib/nfs -%dir /var/lib/nfs/rpc_pipefs -%dir /var/lib/nfs/v4recovery -%attr(0700,statd,nogroup) %dir /var/lib/nfs/sm -%attr(0700,statd,nogroup) %dir /var/lib/nfs/sm.bak -%attr(0700,statd,nogroup) %ghost /var/lib/nfs/state -%config %attr(0644,root,root) /etc/sysconfig/SuSEfirewall2.d/services/nfs-client +%{_mandir}/man5/nfsmount.conf.5%{ext_man} +%{_mandir}/man5/nfs.5%{ext_man} +%{_mandir}/man8/mount.nfs.8%{ext_man} +%{_mandir}/man8/nfsidmap.8%{ext_man} +%{_mandir}/man8/nfsstat.8%{ext_man} +%{_mandir}/man8/rpc.sm-notify.8%{ext_man} +%{_mandir}/man8/showmount.8%{ext_man} +%{_mandir}/man8/sm-notify.8%{ext_man} +%{_mandir}/man8/umount.nfs.8%{ext_man} +%{_mandir}/man8/rpc.gssd.8%{ext_man} +%{_mandir}/man8/rpc.idmapd.8%{ext_man} +%{_mandir}/man8/gssd.8%{ext_man} +%{_mandir}/man8/idmapd.8%{ext_man} +%{_mandir}/man8/svcgssd.8%{ext_man} +%{_mandir}/man8/rpc.statd.8%{ext_man} +%{_mandir}/man8/rpcdebug.8%{ext_man} +%{_mandir}/man8/statd.8%{ext_man} +%{_mandir}/man8/mountstats.8%{ext_man} +%{_mandir}/man8/nfsiostat.8%{ext_man} +%{_mandir}/man8/blkmapd.8%{ext_man} +%{_localstatedir}/adm/fillup-templates/sysconfig.nfs +%attr(0711,statd,nogroup) %dir %{_localstatedir}/lib/nfs +%dir %{_localstatedir}/lib/nfs/rpc_pipefs +%dir %{_localstatedir}/lib/nfs/v4recovery +%attr(0700,statd,nogroup) %dir %{_localstatedir}/lib/nfs/sm +%attr(0700,statd,nogroup) %dir %{_localstatedir}/lib/nfs/sm.bak +%attr(0700,statd,nogroup) %ghost %{_localstatedir}/lib/nfs/state +%config %attr(0644,root,root) %{_sysconfdir}/sysconfig/SuSEfirewall2.d/services/nfs-client %files -n nfs-kernel-server %defattr(-,root,root) @@ -333,20 +309,19 @@ fi %{_sbindir}/rpc.nfsd %{_sbindir}/rpc.svcgssd /sbin/nfsdcltrack -%{_mandir}/man5/exports.5.gz -%{_mandir}/man7/nfsd.7.gz -%{_mandir}/man8/exportfs.8.gz -%{_mandir}/man8/mountd.8.gz -%{_mandir}/man8/nfsd.8.gz -%{_mandir}/man8/rpc.mountd.8.gz -%{_mandir}/man8/rpc.nfsd.8.gz -%{_mandir}/man8/rpc.svcgssd.8.gz -%{_mandir}/man8/nfsdcltrack.8.gz -%{_datadir}/omc/svcinfo.d/nfs-kernel-server.xml -%config(noreplace) /var/lib/nfs/xtab -%config(noreplace) /var/lib/nfs/etab -%config(noreplace) /var/lib/nfs/rmtab -%config %attr(0644,root,root) /etc/sysconfig/SuSEfirewall2.d/services/nfs-kernel-server +%{_mandir}/man5/exports.5%{ext_man} +%{_mandir}/man7/nfsd.7%{ext_man} +%{_mandir}/man8/exportfs.8%{ext_man} +%{_mandir}/man8/mountd.8%{ext_man} +%{_mandir}/man8/nfsd.8%{ext_man} +%{_mandir}/man8/rpc.mountd.8%{ext_man} +%{_mandir}/man8/rpc.nfsd.8%{ext_man} +%{_mandir}/man8/rpc.svcgssd.8%{ext_man} +%{_mandir}/man8/nfsdcltrack.8%{ext_man} +%config(noreplace) %{_localstatedir}/lib/nfs/xtab +%config(noreplace) %{_localstatedir}/lib/nfs/etab +%config(noreplace) %{_localstatedir}/lib/nfs/rmtab +%config %attr(0644,root,root) %{_sysconfdir}/sysconfig/SuSEfirewall2.d/services/nfs-kernel-server %files -n nfs-doc %defattr(-,root,root) diff --git a/nfs-utils_env.sh b/nfs-utils_env.sh index af59868..18ac375 100644 --- a/nfs-utils_env.sh +++ b/nfs-utils_env.sh @@ -33,11 +33,11 @@ if [ "$NFS3_SERVER_SUPPORT" == "no" ]; then fi if [ "$NFS4_SUPPORT" != "yes" ]; then version_params="--no-nfs-version 4" +else + if [ "$NFS4_SERVER_MINOR_VERSION" != "0" ]; then + version_params="$version_params --nfs-version 4 --nfs-version 4.$NFS4_SERVER_MINOR_VERSION" + 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 [ "$USE_KERNEL_NFSD_NUMBER" -gt 0 ]; then threads=$USE_KERNEL_NFSD_NUMBER else @@ -71,7 +71,7 @@ esac mkdir -p /run/sysconfig { echo "RPCIDMAPDARGS=$pipefs" -echo "RPCMOUNTDARGS=$mountdport $MOUNTD_OPTIONS $version_parms" +echo "RPCMOUNTDARGS=$mountdport $MOUNTD_OPTIONS $version_params" echo "RPCNFSDARGS=$NFSD_OPTIONS $version_params $time_params $threads" echo "GSSDARGS=$ignore_dns $GSSD_OPTIONS $pipefs" echo "SMNOTIFYARGS=$SM_NOTIFY_OPTIONS"