I have a Ubuntu machine that takes an iSCSI block, mounts it as ext4, then exports it as an NFS share. On boot, NFS fails to start as the iSCSI directory mounts have not loaded yet.
"exportfs: Failed to stat /mnt/iscsi/nfs: No such file or directory"
This works fine if I run nfs-kernel-server after the server starts.
Is there a way to force NFS to wait till the iSCSI block has been mounted?
Edit: Further investigation.. By forcing nfs-server.service to wait for mnt-iscsi.mount, I've triggered a dependency loop.
Dec 02 09:16:09 on1 systemd[1]: nfs-server.service: Found ordering cycle on mnt-iscsi.mount/start
Dec 02 09:16:09 on1 systemd[1]: nfs-server.service: Found dependency on remote-fs-pre.target/start
Dec 02 09:16:09 on1 systemd[1]: nfs-server.service: Found dependency on nfs-server.service/start
Dec 02 09:16:09 on1 systemd[1]: nfs-server.service: Unable to break cycle starting with nfs-server.service/start
Am stuck trying to figure out what to change.
Thanks!
/etc/systemd/system/iscsi.service
exists but there isn't any nfs-server.service in/etc/systemd/
. I edited/lib/systemd/system/nfs-server.service
and placed a lineAfter=iscsi.service
under[Unit]
but no luck – Joshua Dec 01 '19 at 23:37/lib/systemd/system
, you can create your own custom options for nfs-server in/etc/systemd/system
. See this Ask Ubuntu answer for lots of details. Second, you also may need to runsystemctl daemon-reload
. – ender.qa Dec 02 '19 at 00:33