I have a pacemaker with corosync nfs cluster (Ubuntu 18) and I'm trying to decrease the grace period.
Is there any way to make these settings persistent in /etc/default/nfs-kernel-server
or pacemaker?
echo '10' > /proc/fs/nfsd/nfsv4leasetime
echo '10' > /proc/fs/nfsd/nfsv4gracetime
echo '10' > /proc/sys/fs/nfs/nlm_grace_period
Thank you Killertjuh, I found your answer after asking Zanna's question myself when reading a LINBIT HA guide https://www.linbit.com/downloads/tech-guides/HA_NFS_storage_with_DRBD_and_Pacemaker.pdf.
I recently had to deal with a similar situation with setting the --manage-gids option for my NFSv4 server, and found that these settings could be set in /etc/default, which eliminates the need to modify the script /usr/lib/systemd/scripts/nfs-utils_env.sh. That way you don't have as much risk of having the value overwritten by a future update of the script.
You can set the value in /etc/default/nfs-kernel-server:
I tested and verified this on 18.04.
This might be transitional with a systemctl based methodology. Right now the script is run by the nfs-config systemctl service as a oneshot.
I tried overriding the environment variable in the nfs-kernel-server service but was unable to do it because of the way it is sourced in nfs-config. Perhaps a future release will change this.
find file "/usr/lib/systemd/scripts/nfs-utils_env.sh"
Change the line that starts with "echo RPCNFSDARGS" to:
for more info