From Gentoo Wiki
Jump to:navigation Jump to:search
This is a Talk page - please see the documentation about using talk pages. Add newer comments below older ones, sign comments using four tildes (~~~~), and indent successive comments with colons (:). Add new sections at the bottom of the page, under a heading (== ==). Please remember to mark sections as "open for discussion" using {{talk|open}}, so they will show up in the list of open discussions.


Talk status
This discussion is done.

Hi all, I found very useful this wiki, but it is not covering the case of a systemd based gentoo system:

  • nfsd prerequisite services: openrc manages all the nfsd prerequisites correctly, under systemd instead the services have to be enabled explicitly;
  • nfsd options: under openrc the config file /etc/conf.d/nfs is correctly managed by openrc, under systemd it is not, I had to alter the corresponding systemd service to have similar behaviour.

I realize that maybe this topic should be addressed also to the systemd experts, but it could be convenient at least to mention the differences.

The problem imho it is that the behaviour of a gentoo system is become somewhat different depending to the init system used (openrc or systemd).

Best regards


— The preceding comment was added by Zio-lupo (talkcontribs) 11 January 2015

Hi, I just added some instructions how to get NFS running with systemd, according to

Regards, Markus

— The preceding comment was added by kaindl (talkcontribs) 30 January 2017


Talk status
This discussion is done.

24/01/2017: net-fs/nfs-utils-1.3.4: I have /etc/exports.d/ instead of /etc/exports I am not sure if they are related.. so I used the /etc/exports file cheers, BW

— The preceding comment was added by Bw (talkcontribs) 24 January 2017

See man 5 exports and --Charles17 (talk) 14:13, 24 January 2017 (UTC)

mount.nfs4: Network is unreachable

Talk status
This discussion is still ongoing.

At the time of writing this section, the software versions involved were as following

  1. net-fs/nfs-utils-2.6.1
  2. sys-kernel/gentoo-sources-5.15.75
  3. sys-apps/openrc-0.45.s-r1

About the solutions provided,

  1. Change in /etc/rc.conf should have worked since the logs showed dhcp starting before nfs but it didn't. I may have been able to set more specific dependencies on this file based on the examples to configure specific requirements for services but didn't feelconfident enought and my attempts didn't work so I assumed that I was not doing it right.
  2. Add netwotk to the depend() section on the init script should have worked, eithwe using net or net.enp1s0 but again, that didn't work for me.
  3. Setting a fix IP did the trick for me.

I assume, based on my attempts that dhcp service was too slow to start and was not a requirement for nfs. I may do some more digging about it. But one potential problem that I see with this solution is that after updates to the related packages, the modifications on the init scripts may be lost.

--Patomas (talk) 03:37, 7 November 2022 (UTC)

After finishing the previous message, I edited back the /etc/conf.d/net and reenabled the dhcpcd service, then edited the /etc/init.d/dhcpcd file, adding net.enp1s0 to the line with localmount on the depend() section, removed the net.enp1s0 from the /etc/init.d/nfsclient rebooted and everything worked.
My next step was to put the requirements only on the /etc/init.d/nfsclient, but adding the dhcpcd and net.enp1s0 both there doesn't fix the problem. I suppose that a detection for having IP on /etc/init.d/nfsclient would solve the problem.
So, based on that last attempt, I'll modify the solution provided to reflect the finding.
--Patomas (talk) 04:04, 7 November 2022 (UTC)
Do not mix netifrc (net.*) services and dhcpcd service. They will fight for control unless specifically excluded from each other. If "net.eth0" is set to dhcp, then it starts its own copy of dhcpcd. While the dhcpcd service has another copy trying to hold control of eth0. --Grknight (talk) 14:31, 7 November 2022 (UTC)
In addition, if network is slow to start and you've fixed the services, a better suggestion is to change /etc/conf.d/nfsclient adding rc_need="net-online" (optionally configuring /etc/conf.d/net-online) to ensure that ethernet is fully ready. Or, if using a static IP, rc_need="net.eth0" or whatever service the NFS client needs. --Grknight (talk) 15:06, 7 November 2022 (UTC)
About changing /etc/conf.d/nfsclient, I added rc_need="net.enp1s0" and rc_after="net"which is my specific case and it worked but I didn't report back here. I didn't try rc_need="net-online" before, I was actually trying to find a way to test for a ping on startup and couldn't find a way.
The next step would be to add the solution to the page, should I do it or should you do it?
--Patomas (talk) 07:49, 16 November 2022 (UTC)