- 0001-nfs.conf-allow-empty-assignments.patch
Fix regression due to unnecessary "error" messages from nfs.conf - 0002-Let-systemd-know-when-rpc.statd-is-needed.patch 0003-systemd-run-statd-notify-even-when-nfs-client-isn-t-.patch Fixes for systemd integration (bsc#1116221) OBS-URL: https://build.opensuse.org/package/show/Base:System/nfs-utils?expand=0&rev=197
This commit is contained in:
parent
3a9d86ffbe
commit
5aba4a2d55
55
0001-nfs.conf-allow-empty-assignments.patch
Normal file
55
0001-nfs.conf-allow-empty-assignments.patch
Normal file
@ -0,0 +1,55 @@
|
||||
From b8ebadacd1ccf943e3c699027bdc64bdcf5e9f37 Mon Sep 17 00:00:00 2001
|
||||
From: NeilBrown <neilb@suse.com>
|
||||
Date: Mon, 3 Dec 2018 11:54:16 +1100
|
||||
Subject: [PATCH] nfs.conf: allow empty assignments.
|
||||
|
||||
A recent commit caused an error message (but didn't actually
|
||||
trigger an error) for a config file line like:
|
||||
|
||||
foo =
|
||||
|
||||
There is no good reason to treat this as an error, and we (SUSE) have
|
||||
established practice of expecting these to be accepted.
|
||||
Specifically "/etc/nfs.conf" includes "/etc/sysconfig/nfs" which
|
||||
contains lots of empty definitions.
|
||||
|
||||
So remove the error message.
|
||||
|
||||
Fixes: 1c2c18806800 ("nfs.conf: Removed buffer overruns")
|
||||
Signed-off-by: NeilBrown <neilb@suse.com>
|
||||
---
|
||||
support/nfs/conffile.c | 5 -----
|
||||
tests/nfsconf/01-errors.exp | 1 -
|
||||
2 files changed, 6 deletions(-)
|
||||
|
||||
diff --git a/support/nfs/conffile.c b/support/nfs/conffile.c
|
||||
index 0e39aca6b468..77c5790c893c 100644
|
||||
--- a/support/nfs/conffile.c
|
||||
+++ b/support/nfs/conffile.c
|
||||
@@ -405,11 +405,6 @@ conf_parse_line(int trans, char *line, const char *filename, int lineno, char **
|
||||
"missing tag in assignment", filename, lineno);
|
||||
return;
|
||||
}
|
||||
- if (*val == '\0') {
|
||||
- xlog_warn("config error at %s:%d: "
|
||||
- "missing value in assignment", filename, lineno);
|
||||
- return;
|
||||
- }
|
||||
|
||||
if (strcasecmp(line, "include")==0) {
|
||||
/* load and parse subordinate config files */
|
||||
diff --git a/tests/nfsconf/01-errors.exp b/tests/nfsconf/01-errors.exp
|
||||
index 2bf1b8c7f65b..0b985b46267e 100644
|
||||
--- a/tests/nfsconf/01-errors.exp
|
||||
+++ b/tests/nfsconf/01-errors.exp
|
||||
@@ -4,7 +4,6 @@ nfsconf: config error at 01-errors.conf:10: non-matched ']', ignoring until next
|
||||
nfsconf: config error at 01-errors.conf:11: ignoring line not in a section
|
||||
nfsconf: config error at 01-errors.conf:14: line not empty and not an assignment
|
||||
nfsconf: config error at 01-errors.conf:15: missing tag in assignment
|
||||
-nfsconf: config error at 01-errors.conf:16: missing value in assignment
|
||||
nfsconf: config error at 01-errors.conf:18: unmatched quotes
|
||||
[four]
|
||||
four = foo = bar
|
||||
--
|
||||
2.14.0.rc0.dirty
|
||||
|
54
0002-Let-systemd-know-when-rpc.statd-is-needed.patch
Normal file
54
0002-Let-systemd-know-when-rpc.statd-is-needed.patch
Normal file
@ -0,0 +1,54 @@
|
||||
From b468dda439a02c4d1b7f85a0be6c0a227d16c2de Mon Sep 17 00:00:00 2001
|
||||
From: NeilBrown <neilb@suse.com>
|
||||
Date: Fri, 30 Nov 2018 16:38:45 +1100
|
||||
Subject: [PATCH] Let systemd know when rpc.statd is needed.
|
||||
|
||||
A recent change to set IgnoreOnIsolate for rpc-statd
|
||||
isn't quite sufficient (though it doesn't hurt).
|
||||
While rpc-statd does remain when
|
||||
systemctl isolate multi-user
|
||||
is run, its dependencies don't remain, so rpcbind might
|
||||
get killed, which makes rpc.statd rather useless.
|
||||
|
||||
The reason this is all an issue is that systemd doesn't know that
|
||||
rpc-statd is needed - mount.nfs explicitly starts it rather than
|
||||
having a dependency start it.
|
||||
This can be rectified by explicitly telling systemd about the
|
||||
dependency using "systemctl add-wants". This can be done in the
|
||||
start-statd script, at the same time that rpc-statd is started.
|
||||
|
||||
As --runtime dependency is used so that it doesn't persist across
|
||||
reboots. A new dependency will be created on next boot if an NFSv3
|
||||
filesystem is mounted.
|
||||
|
||||
With this in place, both rpc.statd and rpcbind remain.
|
||||
Actually, rpcbind.service is stopped, but rpcbind.socket remains,
|
||||
and when anything tries to contact rpcbind, rpcbind.service
|
||||
is automatically started and it re-reads its saved state.
|
||||
|
||||
Signed-off-by: NeilBrown <neilb@suse.com>
|
||||
---
|
||||
utils/statd/start-statd | 7 ++++++-
|
||||
1 file changed, 6 insertions(+), 1 deletion(-)
|
||||
|
||||
diff --git a/utils/statd/start-statd b/utils/statd/start-statd
|
||||
index 82715b40c1af..54ced822016a 100755
|
||||
--- a/utils/statd/start-statd
|
||||
+++ b/utils/statd/start-statd
|
||||
@@ -20,7 +20,12 @@ fi
|
||||
# First try systemd if it's installed.
|
||||
if [ -d /run/systemd/system ]; then
|
||||
# Quit only if the call worked.
|
||||
- systemctl start rpc-statd.service && exit
|
||||
+ if systemctl start rpc-statd.service; then
|
||||
+ # Ensure systemd knows not to stop rpc.statd or its dependencies
|
||||
+ # on 'systemctl isolate ..'
|
||||
+ systemctl add-wants --runtime remote-fs.target rpc-statd.service
|
||||
+ exit 0
|
||||
+ fi
|
||||
fi
|
||||
|
||||
cd /
|
||||
--
|
||||
2.14.0.rc0.dirty
|
||||
|
@ -0,0 +1,38 @@
|
||||
From 415dea8db90785c3063bbd74fff34cb6a4830f06 Mon Sep 17 00:00:00 2001
|
||||
From: NeilBrown <neilb@suse.com>
|
||||
Date: Fri, 30 Nov 2018 16:44:29 +1100
|
||||
Subject: [PATCH] systemd: run statd-notify even when nfs-client isn't enabled.
|
||||
|
||||
When NFS filesytems are mounted, nfs-client.target really should
|
||||
be enabled. However it is possible to mount NFS filesystems
|
||||
without this (providing gss isn't used) and it mostly works.
|
||||
|
||||
One aspect that doesn't work is that sm-notify isn't run, so the server
|
||||
isn't told to drop any locks from the previous client instance.
|
||||
This can result in confusing failures: if a client crashes while
|
||||
holding a lock, it won't be able to get the same lock after a reboot.
|
||||
|
||||
While this isn't a complete solution (nfs-client really should be
|
||||
enabled), adding a dependency from rpc-statd to rpc-statd-notify is
|
||||
easy, has no down sides, and could help avoid confusion.
|
||||
|
||||
Signed-off-by: NeilBrown <neilb@suse.com>
|
||||
---
|
||||
systemd/rpc-statd.service | 1 +
|
||||
1 file changed, 1 insertion(+)
|
||||
|
||||
diff --git a/systemd/rpc-statd.service b/systemd/rpc-statd.service
|
||||
index 1f4e6a8b92ab..3e92cf71add0 100644
|
||||
--- a/systemd/rpc-statd.service
|
||||
+++ b/systemd/rpc-statd.service
|
||||
@@ -4,6 +4,7 @@ DefaultDependencies=no
|
||||
Conflicts=umount.target
|
||||
Requires=nss-lookup.target rpcbind.socket
|
||||
Wants=network-online.target
|
||||
+Wants=rpc-statd-notify.service
|
||||
After=network-online.target nss-lookup.target rpcbind.socket
|
||||
|
||||
PartOf=nfs-utils.service
|
||||
--
|
||||
2.14.0.rc0.dirty
|
||||
|
@ -8,7 +8,7 @@
|
||||
|
||||
--- a/support/nfs/exports.c
|
||||
+++ b/support/nfs/exports.c
|
||||
@@ -657,6 +657,8 @@ bad_option:
|
||||
@@ -658,6 +658,8 @@ bad_option:
|
||||
} else if (strncmp(opt, "replicas=", 9) == 0) {
|
||||
ep->e_fslocmethod = FSLOC_REPLICA;
|
||||
ep->e_fslocdata = strdup(opt+9);
|
||||
|
@ -1,3 +1,14 @@
|
||||
-------------------------------------------------------------------
|
||||
Mon Dec 3 02:49:13 UTC 2018 - Neil Brown <nfbrown@suse.com>
|
||||
|
||||
- 0001-nfs.conf-allow-empty-assignments.patch
|
||||
Fix regression due to unnecessary "error" messages from nfs.conf
|
||||
|
||||
- 0002-Let-systemd-know-when-rpc.statd-is-needed.patch
|
||||
0003-systemd-run-statd-notify-even-when-nfs-client-isn-t-.patch
|
||||
Fixes for systemd integration
|
||||
(bsc#1116221)
|
||||
|
||||
-------------------------------------------------------------------
|
||||
Thu Oct 25 05:32:30 UTC 2018 - Neil Brown <nfbrown@suse.com>
|
||||
|
||||
|
@ -47,6 +47,9 @@ Source25: rpc-svcgssd.options.conf
|
||||
Source26: nfs.conf
|
||||
Source27: nfs-kernel-server.tmpfiles.conf
|
||||
Patch0: nfs-utils-1.0.7-bind-syntax.patch
|
||||
Patch1: 0001-nfs.conf-allow-empty-assignments.patch
|
||||
Patch2: 0002-Let-systemd-know-when-rpc.statd-is-needed.patch
|
||||
Patch3: 0003-systemd-run-statd-notify-even-when-nfs-client-isn-t-.patch
|
||||
|
||||
BuildRequires: e2fsprogs-devel
|
||||
BuildRequires: fedfs-utils-devel
|
||||
@ -144,6 +147,9 @@ This package contains additional NFS documentation.
|
||||
%prep
|
||||
%setup -q -a 1
|
||||
%patch0 -p1
|
||||
%patch1 -p1
|
||||
%patch2 -p1
|
||||
%patch3 -p1
|
||||
|
||||
cp %{SOURCE6} .
|
||||
|
||||
|
Loading…
Reference in New Issue
Block a user