From 83fb1a5e118484b781d9a3800476c98e7900e5bb Mon Sep 17 00:00:00 2001 From: Franziska Kunsmann Date: Sun, 20 Feb 2022 19:44:05 +0100 Subject: [PATCH] bundles/nfs-client: decrease timeout, set some default mount options --- bundles/nfs-client/files/nfs.automount | 2 +- bundles/nfs-client/files/nfs.mount | 2 ++ bundles/nfs-client/items.py | 6 ++++++ 3 files changed, 9 insertions(+), 1 deletion(-) diff --git a/bundles/nfs-client/files/nfs.automount b/bundles/nfs-client/files/nfs.automount index 4854213..c0e2cda 100644 --- a/bundles/nfs-client/files/nfs.automount +++ b/bundles/nfs-client/files/nfs.automount @@ -3,7 +3,7 @@ Description=Automount ${mount} on access [Automount] Where=${mountpoint} -TimeoutIdleSec=5min +TimeoutIdleSec=30 [Install] WantedBy=local-fs.target diff --git a/bundles/nfs-client/files/nfs.mount b/bundles/nfs-client/files/nfs.mount index da4823a..e11f4c0 100644 --- a/bundles/nfs-client/files/nfs.mount +++ b/bundles/nfs-client/files/nfs.mount @@ -9,6 +9,8 @@ What=${serverpath} Where=${mountpoint} Type=nfs Options=${','.join(sorted(mount_options))} +ForceUnmount=yes +TimeoutSec=10 [Install] WantedBy=multi-user.target diff --git a/bundles/nfs-client/items.py b/bundles/nfs-client/items.py index b2d072a..f800922 100644 --- a/bundles/nfs-client/items.py +++ b/bundles/nfs-client/items.py @@ -19,6 +19,12 @@ for mount, data in node.metadata.get('nfs-client/mounts',{}).items(): if parameter in data: directories[data['mountpoint']][parameter] = data[parameter] + if 'suid' not in data['mount_options']: + data['mount_options'].add('nosuid') + + if 'hard' not in data['mount_options']: + data['mount_options'].add('soft') + if data.get('automount', True): data['mount_options'].add('x-systemd.automount')