holo
holo copied to clipboard
holo-users-groups: home directory is not created
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
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.
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.
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.
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?
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.