Skip to content
This repository was archived by the owner on Aug 27, 2018. It is now read-only.

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

Merged
peti merged 1 commit intoNixOS:masterfrom
offlinehacker:fix/stage_2_lib_var_db
Sep 30, 2013
Merged

stage-2-init: create /var/lib and /var/db at boot, so some modules that create user home folders here don't fail#262
peti merged 1 commit intoNixOS:masterfrom
offlinehacker:fix/stage_2_lib_var_db

Conversation

@offlinehacker
Copy link
Contributor

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
Copy link
Contributor Author

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

@domenkozar
Copy link
Member

Perhaps home dir should be created with -p flag?

@offlinehacker
Copy link
Contributor Author

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.

peti added a commit that referenced this pull request Sep 30, 2013
stage-2-init: create /var/lib and /var/db at boot, so some modules that create user home folders here don't fail
@peti peti merged commit c811d79 into NixOS:master Sep 30, 2013
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants