[Nix-dev] NixOS network filesystems mounting

Rickard Nilsson rickard.nilsson at telia.com
Tue Apr 17 14:02:03 CEST 2012


Hi,

I continue to wrestle with NFS in NixOS. My current problem started when I  
changed the /etc/hosts file to be generated like this:

127.0.0.1 localhost

I did that because I think mapping the hostname to 127.0.0.1 is wrong. And  
adding the domain to localhost (as in localhost.mydomain.com) makes no  
sense either. But we can discuss that in another thread.

However, this had the unfortunate consequence that idmapd failed setting  
the domain that was specified in its configuration file, and instead used  
"localdomain". This made id mapping stop working, since my NFS server is  
set up with a proper domain. The reason that idmapd didn't use the  
specified domain I think is because at the time idmapd starts (after udev  
startup), the /etc/resolv.conf is not set up.

What all this boils down to, is that I think the way NixOS mounts network  
filesystems is a bit messy. It first tries to mount all filesystems, and  
then when it get an ip-up event, it makes a new attempt which should cause  
network filesystems to be mounted. However, wouldn't it be better to  
separate local and network filesystems into two different stages? After  
udev, mount all local paths. After ip-up, start the NFS daemons and mount  
all remote paths. What do you think? I will try to experiment with this  
and see how it works out. If it fails, I must at least find a way to not  
start idmapd until ip-up.

Regards,
   Rickard Nilsson


More information about the nix-dev mailing list