[Nix-dev] Debugging NixOS login problems

Rickard Nilsson rickard.nilsson at telia.com
Fri May 6 14:49:37 CEST 2011


 On Fri, 06 May 2011 14:26:51 +0200, Marc Weber <marco-oweber at gmx.de> 
 wrote:
> Excerpts from Rickard Nilsson's message of Fri May 06 13:32:21 +0200 
> 2011:
>>  Does anyone have a suggestion on how to debug this?
>
> AFAIK PAM is used for logging in. However what you describe doesn't 
> make
> sense to me.
>
> I recall you can make PAM print or log messages.
>
> However maybe its faster to try chrooting eg from a live cd and try
> passwd or such setting a passowrd and examining the user's shell
> setting.

 This is a good suggestion, I'll try doing it. When chrooting, do I need 
 to run any activation script or so to set the Nix environment paths?


> You didn't mention your way of installation.

 I installed with the ordinary installation cd, but instead of mounting 
 a plain partition on /mnt, I mounted an NFS share. Also I disabled Grub 
 since I boot with gPXE:

   boot.loader.grub.enable = true;
   boot.loader.grub.device = "nodev";

 I also have the following in configuration.nix in order to set up the 
 network on boot:

   boot.initrd.extraUtilsCommands =
     ''
       cp ${pkgs.iproute}/sbin/ip $out/bin
       cp ${pkgs.glibc}/lib/libresolv.so.* $out/lib

       cp ${pkgs.nfsUtils}/sbin/mount.nfs $out/bin
       cp ${pkgs.klibc}/lib/klibc/bin.static/nfsmount $out/bin
     '';

   boot.initrd.postDeviceCommands =
     ''
       ip link set eth0 up
       ip addr add 192.168.0.200/24 dev eth0
     '';

 However, I haven't got the NFS mount to work automatically yet. Instead 
 I have:

    mountPoint = "/";
    fsType = "none";
    device = "none";

 And then I mount the root manually with "nfsmount 
 192.168.0.1:/export/nixos_root /mnt-root" when init stage 1 complains 
 that it can't mount the root device.


> You can even try start ttyX from chroot after stopping tty from the 
> live
> cd.

 Thanks for the tip.


> Why are you using NFS? I never tried booting from NFS. I think it 
> should
> not make a difference. Do you mount rw or ro?
> Maybe that also makes a difference (guessing)
> I know that login writes to the disk keeping the last login 
> timestamp.

 I am using NFS because my computer is a diskless one. I'm trying to 
 replicate my current ArchLinux setup which is gPXE for loading the 
 kernel and initrd over http, and NFS for mounting the root and other 
 filesystems. I mount the root rw, I have not separated /var, /usr etc 
 (yet).


   / Rickard Nilsson




More information about the nix-dev mailing list