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

fix impermanence in combination with sysusers/userborn #223

Open
wants to merge 2 commits into
base: master
Choose a base branch
from

Conversation

Mic92
Copy link
Member

@Mic92 Mic92 commented Oct 4, 2024

Both remove user creation from the action phase to a systemd service. This is hopefully also easier to debug, since we now can look at a systemd service instead for log output.

@Mic92 Mic92 force-pushed the userborn-support branch from 39ac7c7 to 4b34e65 Compare October 4, 2024 12:43
@Mic92 Mic92 marked this pull request as draft October 4, 2024 12:43
@Mic92 Mic92 force-pushed the userborn-support branch 3 times, most recently from af08f1b to 0bc0d03 Compare October 4, 2024 13:08
Both remove user creation from the action phase to a systemd service.
This is hopefully also easier to debug, since we now can look at a
systemd service instead for log output.
@Mic92 Mic92 force-pushed the userborn-support branch 3 times, most recently from d5f21cf to 8495848 Compare October 4, 2024 13:42
No idea how this ever worked, but for me all directories in /persistent
never have the write user/group permissions when freshly created.
This now also ensures that permissions will change if the configuration
changes, which is a nice side effect.
@Mic92 Mic92 force-pushed the userborn-support branch from f1d0251 to 32b1094 Compare October 4, 2024 13:48
@Mic92 Mic92 marked this pull request as ready for review October 4, 2024 13:51
# synchronize perms between source and target
chown --reference="$realSource" "$target"
chmod --reference="$realSource" "$target"
chown "$user:$group" "$realSource" "$target"
Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

See commit message for reasoning.

Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I'm a bit skeptical of this, since it would apply mode changes to already existing directories, whether a mode is supplied for the directory or not. I'm not really sure what's not working for you, though. Are the initial directories created with the incorrect permissions?

Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Also, I guess this isn't critical for the main purpose of this PR, so maybe it could be moved to its own?

@Mic92 Mic92 requested a review from talyz October 4, 2024 13:52
@Mic92
Copy link
Member Author

Mic92 commented Oct 4, 2024

Can be tested with

nix run github:Mic92/userborn-with-impermanence#nixosConfigurations.myhost.config.system.build.vmWithDisko

In the vm do:

ls -la /home/user

to see that permissions and owners are correct now.

Copy link
Collaborator

@talyz talyz left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Looks like you're moving a lot of code from one scope to another, but it's intermixed with your actual changes. Please split out the move to its own commit, so that it's easier to review the changes.

# synchronize perms between source and target
chown --reference="$realSource" "$target"
chmod --reference="$realSource" "$target"
chown "$user:$group" "$realSource" "$target"
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I'm a bit skeptical of this, since it would apply mode changes to already existing directories, whether a mode is supplied for the directory or not. I'm not really sure what's not working for you, though. Are the initial directories created with the incorrect permissions?

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

Successfully merging this pull request may close these issues.

2 participants