Skip to content

Commit

Permalink
nfsd.service: Order after mxmount.service
Browse files Browse the repository at this point in the history
Currently there is no order between nfsd.service and mxmount.service. If
mxmount is slow (e.g. when file systems have to process their journals
after a server crash), nfsd startup might execute `exportfs -ra` while
the filesystems are not yet mounted, thereby exporting the unmounted
mountpoints.

This can result in mount failures on nfs clients or in "stale NFS
handle" errors on clients, which had the filesystems mounted before the
crash.

mxmount.service uses `mxmount --noexport` so there is no reexport
triggered, after the filesystems are mounted. nfsd.services executes
additional `exportfs -ra` commands 10, 20 and 30 seconds after the nfsd
startup, but 30 seconds might not be enough time to mount all
filesystems after the crash of a fileserver.

These errors can persist. They are partly resolved by a manual `exportfs
-ra` after a longer time, making the file systems available for
mounting. However, the "stale NFS handle" problem might still be visible
on clients which picked up the now covered inodes of the mountpoints.

Order nfsd.service after mxmount.service so that we don't export the
mountpoints.
  • Loading branch information
donald committed Nov 17, 2021
1 parent da06861 commit 00d49f7
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion misc_systemd_units/nfsd.service
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@
Description=NFS Daemon
ConditionPathExists=/etc/exports
Requires=local-fs.target proc-fs-nfsd.mount var-lib-nfs-rpc_pipefs.mount
After=local-fs.target proc-fs-nfsd.mount var-lib-nfs-rpc_pipefs.mount unbound.service
After=local-fs.target proc-fs-nfsd.mount var-lib-nfs-rpc_pipefs.mount unbound.service mxmount.service
Wants=unbound.service

[Service]
Expand Down

0 comments on commit 00d49f7

Please sign in to comment.