NixOS / nixos

OBSOLETE (go to NixOS/nixpkgs) - NixOS, a Linux distribution based on the Nix package manager - OBSOLETE (go to NixOS/nixpkgs)
MIT License
176 stars 102 forks source link

stage-2-init: create /var/lib and /var/db at boot, so some modules that create user home folders here don't fail #262

Closed offlinehacker closed 11 years ago

offlinehacker commented 11 years ago

It was pretty nasty bug, that was hard to spot. But as soon as i started doing vm tests i saw that happening.

For example lets say this module snippet from bacula (to show this is not related only with my modules):

    libDir = "/var/lib/bacula";

    users.extraUsers.bacula = {
      group = "bacula";
      uid = config.ids.uids.bacula;
      home = "${libDir}";
      createHome = true;
      description = "Bacula Daemons user";
      shell = "${pkgs.bash}/bin/bash";
    };

There's no way this home will be created on boot, because when useradd tries to create home /var/lib/ does not yet exist.

offlinehacker commented 11 years ago

I think this should be merged before release, because it fixes quite some modules.

domenkozar commented 11 years ago

Perhaps home dir should be created with -p flag?

offlinehacker commented 11 years ago

Yes, but what about permissions? Here we can change them as necessary if needed. I think this should still be merged and also home created with -p, this would be the best. I actually don't care which solution(or both), i just want to notice that this bug must be fixed.

I personally created this one, because there's already a pull request that would be probably merged after release related to users and homes, and i don't want to patch old code.