Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

holo-users-groups: home directory is not created #49

Open
mipimipi opened this issue Nov 7, 2018 · 5 comments
Open

holo-users-groups: home directory is not created #49

mipimipi opened this issue Nov 7, 2018 · 5 comments

Comments

@mipimipi
Copy link

mipimipi commented Nov 7, 2018

Hi,
I use the following toml file to create a user:

[[user]]
name    = "mipi"
system  = false
comment = "mipi"
groups  = [ "wheel", "network", "audio", "video", "sys" ]
home    = "/home/mipi"
shell   = "/usr/bin/zsh"

But though I specify a home directory, it is not created. When I logon as user mipi, I get the error message

mkdir: cannot create directory '/home/mipi': Permission denied

How can I resolve this?

Thanks, mipi

@majewsky
Copy link
Contributor

majewsky commented Nov 7, 2018

I usually put the user's home directory in the configuration package, e.g. https://github.com/majewsky/system-configuration/blob/30dbd7c9e2ef0c66dd7eea398755706a3e05be8b/hologram-archlinux-mirror.pkg.toml#L15-L24 (Note that this is a package declaration for holo-build, not for holo-users-groups directly.)

Doing this separately, while slightly more tedious, has the advantage that you have explicit control over ownership and permissions of the homedir.

@mipimipi
Copy link
Author

mipimipi commented Nov 9, 2018

Did it now the same way and it worked :-)
However, I'd expect that holo-users-groups creates the homedir if it's not existing, esp. if it's specified explicitely in the toml file.

@majewsky
Copy link
Contributor

I agree that this would be a useful option. A create_home = true option should be added to holo-users-groups that mirrors the --create-home switch of useradd(8). It's not a priority for me, but if anyone reading this feels like adding this, I'll be happy to review a PR.

@mipimipi
Copy link
Author

I think I could do that. After looking into the coding, I believe that adding that feature is not a big deal. I still did not get how the test suite is working. Which steps would I have to execute to
(a) include a test for the new feature into the test suite and
(b) test the new feature?

@WhyNotHugo
Copy link
Contributor

WhyNotHugo commented Jul 27, 2022

I looked at this last evening a bit. It's not as straightforward as it seems:

  • If the entity definition changes, do we move the home directory, create a new one, or ignore the change?
  • If the user is removed, do we remove the home, or leave it? What if it has files?

For both there seems to be no "obviously correct" behaviour. I'd like to see this feature, but I'm not 100% it can be implemented in a non-problematic way.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

3 participants