From 44f4cc6b99ba8da90cb27fa7ebd41db5550c2a47 Mon Sep 17 00:00:00 2001 From: Donald Buczek Date: Mon, 6 Jul 2020 09:14:30 +0200 Subject: [PATCH] nfsd.service: Retry exports Our fileservers sometimes don't export to all clients after reboot. This can be fixed by manually executing `exportfs -r`. This might be caused by DNS lookup timeouts when the local unbound server has no cache yet and thus has to pull DNSKEY records from remove servers. Try to mitigate the problem by doing additional `exportfs -r` commands 10,30 and 60 seconds after the nfsd.service unit was started. --- misc_systemd_units/nfsd.service | 1 + 1 file changed, 1 insertion(+) diff --git a/misc_systemd_units/nfsd.service b/misc_systemd_units/nfsd.service index dbfd2af..7270763 100644 --- a/misc_systemd_units/nfsd.service +++ b/misc_systemd_units/nfsd.service @@ -9,6 +9,7 @@ ExecStartPre=/bin/mkdir -p /var/lib/nfs/v4recovery ExecStartPre=/usr/sbin/exportfs -ra ExecStart=/usr/sbin/rpc.mountd --foreground --manage-gids ExecStartPost=/usr/sbin/rpc.nfsd --lease-time 90 --grace-time 90 --no-nfs-version 3 64 ; /usr/sbin/sm-notify +ExecStartPost=bash -c "(sleep 10;exportfs -r;sleep 20;exportfs -r;sleep 30;exportfs -r)&" ExecReload=/usr/sbin/exportfs -ra ExecStopPost=/usr/sbin/rpc.nfsd 0 ; /usr/sbin/exportfs -ua Restart=always