5073990325
The significant update is that configuration can now be read from a central /etc/nfs.conf file, and it can include other files such as /etc/sysconfig/nfs This means that the old nfs-config.service systemd unit is no longer needed. - /etc/nfs.conf file created to import all sysconfig settings except *_OPTIONS directly into running code. - dropins created to pass *_OPTIONS sysconfig setting to the various daemons. - various specfile improvements, such as using "-D" in "install" commands, and adding "verify_permissions". - "xtab" has not been needed for years and has now been remove. - sysconfig.nfs updated, particular the ServiceRestart declarations have been tuned for systemd units. - 0003-nfs-server-generator-handle-noauto-mounts-correctly.patch Fix the nfs-server-generator so that mounts marked "noauto" are not automatically mounted when NFS exported. (bsc#1019211) - 0001-conffile-ignore-empty-environment-variables.patch 0002-mount-call-setgroups-before-setuid.patch Other minor fixes found during testing. - REMOVED 0001-Make-location-of-nfs-utils_env.sh-configurable.patch now included upstream OBS-URL: https://build.opensuse.org/package/show/Base:System/nfs-utils?expand=0&rev=177
72 lines
2.1 KiB
Diff
72 lines
2.1 KiB
Diff
From 93b39628e0a2053d9b37cab7a60d78f782cb88ea Mon Sep 17 00:00:00 2001
|
|
From: NeilBrown <neilb@suse.com>
|
|
Date: Wed, 8 Feb 2017 12:56:38 +1100
|
|
Subject: [PATCH] nfs-server-generator: handle 'noauto' mounts correctly.
|
|
|
|
When this code was written the systemd documentation stated
|
|
that "RequiresMountsFor" ignored mountpoints marked as "noauto".
|
|
Unfortunately this is incorrect. Consquently a filesystem marked
|
|
as noauto that is also NFS exported will currently be mounted when
|
|
the NFS server is started. This is not what people expect.
|
|
|
|
So add a check for the noauto flag. If any ancestor of a given
|
|
export point has the noauto flag, no RequiresMountsFor will be
|
|
generated for that point.
|
|
|
|
Also skip RequiresMountsFor for exports marked 'mountpoint', as their
|
|
absence is, theoretically, already handled by mountd.
|
|
|
|
URL: https://github.com/systemd/systemd/issues/5249
|
|
Signed-off-by: NeilBrown <neilb@suse.com>
|
|
---
|
|
systemd/nfs-server-generator.c | 26 ++++++++++++++++++++++++++
|
|
1 file changed, 26 insertions(+)
|
|
|
|
diff --git a/systemd/nfs-server-generator.c b/systemd/nfs-server-generator.c
|
|
index cc99969e9922..4aa65094ca07 100644
|
|
--- a/systemd/nfs-server-generator.c
|
|
+++ b/systemd/nfs-server-generator.c
|
|
@@ -84,6 +84,28 @@ static void systemd_escape(FILE *f, char *path)
|
|
}
|
|
}
|
|
|
|
+static int has_noauto_flag(char *path)
|
|
+{
|
|
+ FILE *fstab;
|
|
+ struct mntent *mnt;
|
|
+
|
|
+ fstab = setmntent("/etc/fstab", "r");
|
|
+ if (!fstab)
|
|
+ return 0;
|
|
+
|
|
+ while ((mnt = getmntent(fstab)) != NULL) {
|
|
+ int l = strlen(mnt->mnt_dir);
|
|
+ if (strncmp(mnt->mnt_dir, path, l) != 0)
|
|
+ continue;
|
|
+ if (path[l] && path[l] != '/')
|
|
+ continue;
|
|
+ if (hasmntopt(mnt, "noauto"))
|
|
+ break;
|
|
+ }
|
|
+ fclose(fstab);
|
|
+ return mnt != NULL;
|
|
+}
|
|
+
|
|
int main(int argc, char *argv[])
|
|
{
|
|
char *path;
|
|
@@ -124,6 +146,10 @@ int main(int argc, char *argv[])
|
|
for (exp = exportlist[i].p_head; exp; exp = exp->m_next) {
|
|
if (!is_unique(&list, exp->m_export.e_path))
|
|
continue;
|
|
+ if (exp->m_export.e_mountpoint)
|
|
+ continue;
|
|
+ if (has_noauto_flag(exp->m_export.e_path))
|
|
+ continue;
|
|
if (strchr(exp->m_export.e_path, ' '))
|
|
fprintf(f, "RequiresMountsFor=\"%s\"\n",
|
|
exp->m_export.e_path);
|
|
--
|
|
2.11.0
|
|
|