armdran Posted March 16, 2023 Posted March 16, 2023 (edited) I did install an apt install nfs-kernel-server nfs-common on my bananaPi M1. I did export some dirs and successfully mounted them from my clients. After a reboot the mounts did not work. Then I manually invoked exportfs -a and the client were able to mount. What is the correct way to get the nfs server started after a reboot? Edited March 16, 2023 by armdran rework 0 Quote
armdran Posted March 16, 2023 Author Posted March 16, 2023 I have found that the systemd nfs-server unit fails because it cannot resolve hostnames when the service starts up after reboot. I tried to add the following to the Unit, but it still fails. Requires=network-online.target After=network-online.target It seems that others are also struggling with it and there is no good solution but only workarounds. 0 Quote
bedna Posted January 30, 2024 Posted January 30, 2024 I am running a nfs share on my rpi4 and got curious (I use ip addresses rather than host-names, so that could be an extra layer you have to make sure is loaded before it is trying to connect), because I just created the /etc/exports, exportfs -ra, reloaded the systemd daemon and enabled nfs-server.service. So I checked the service file itself. This is on raspberry pi os, not armbian. Mine contains way more dependencies than just network-online.target, maybe you can use this to figure it out: $ cat /lib/systemd/system/nfs-server.service [Unit] Description=NFS server and services DefaultDependencies=no Requires=network.target proc-fs-nfsd.mount Requires=nfs-mountd.service Wants=rpcbind.socket Wants=nfs-idmapd.service After=local-fs.target After=network.target proc-fs-nfsd.mount rpcbind.socket nfs-mountd.service After=nfs-idmapd.service rpc-statd.service Before=rpc-statd-notify.service # GSS services dependencies and ordering Wants=auth-rpcgss-module.service After=rpc-gssd.service gssproxy.service rpc-svcgssd.service # start/stop server before/after client Before=remote-fs-pre.target Wants=nfs-config.service After=nfs-config.service [Service] EnvironmentFile=-/run/sysconfig/nfs-utils Type=oneshot RemainAfterExit=yes ExecStartPre=/usr/sbin/exportfs -r ExecStart=/usr/sbin/rpc.nfsd $RPCNFSDARGS ExecStop=/usr/sbin/rpc.nfsd 0 ExecStopPost=/usr/sbin/exportfs -au ExecStopPost=/usr/sbin/exportfs -f ExecReload=/usr/sbin/exportfs -r [Install] WantedBy=multi-user.target 0 Quote
Recommended Posts
Join the conversation
You can post now and register later. If you have an account, sign in now to post with your account.
Note: Your post will require moderator approval before it will be visible.