Skip to content

nfsd.service: Fix startup gap #400

Open
wants to merge 1 commit into
base: master
Choose a base branch
from
Open
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Jump to
Jump to file
Failed to load files.
Diff view
Diff view
5 changes: 4 additions & 1 deletion etc/systemd/system/nfsd.service
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,9 @@ ConditionPathExists=/etc/exports
Requires=proc-fs-nfsd.mount var-lib-nfs-rpc_pipefs.mount
After=proc-fs-nfsd.mount var-lib-nfs-rpc_pipefs.mount
After=sysinit.target
After=mxmount.service
After=network-online.target
Wants=network-online.target
Conflicts=shutdown.target

[Service]
Expand All @@ -12,7 +15,7 @@ ExecStart=/usr/sbin/rpc.mountd --foreground --manage-gids
ExecStartPost=/usr/sbin/rpc.nfsd --lease-time 90 --grace-time 90 --no-nfs-version 3 8
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
ExecStopPost=/usr/sbin/rpc.nfsd 0
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

The upstream systemd unit has:

  22 [Service]
  23 Type=oneshot
  24 RemainAfterExit=yes
  25 ExecStartPre=-/usr/sbin/exportfs -r
  26 ExecStart=/usr/sbin/rpc.nfsd
  27 ExecStop=/usr/sbin/rpc.nfsd 0
  28 ExecStopPost=/usr/sbin/exportfs -au
  29 ExecStopPost=/usr/sbin/exportfs -f
  30 
  31 ExecReload=-/usr/sbin/exportfs -r

Copy link
Collaborator Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I'm not sure, why exportfs -u is in there.

Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Sorry can you elaborate on the relationship of not unexporting and manual page quote?

Unexporting Directories

The third synopsis shows how to unexport a currently exported directory. When using exportfs ‐ua, all entries listed in /var/lib/nfs/etab are removed from the kernel export tables, and the file is cleared. This effectively shuts down all NFS activity.

[…]

When unexporting a network or domain entry, any current exports to members of this group will be checked against the remaining valid exports and if they themselves are no longer valid they will be removed.

Isn’t This effectively shuts down all NFS activity. what we want?

Restart=always

[Install]
Expand Down