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

mv: Behavior different from gnu when moving directory symbolic links (nixos-rebuild switch fails) #6351

Open
LuNeder opened this issue May 4, 2024 · 1 comment
Labels

Comments

@LuNeder
Copy link

LuNeder commented May 4, 2024

Hey, (as we were talking on #help on Discord) I think we might actually have a bug here. (edit: well, we do - it was reproduced)

When I try rebuilding switch my NixOS system, even using the gnu ln (due to #6350) I still stumble on that mv error making the switch fail. See: https://github.com/LuNeder/nixos-config/blob/62092e522557eebe13946f5fa5a4b16b53faa6e0/new-new-log-file

This mv: cannot move '/run/wrappers/bin-tmp' to '/run/wrappers/bin': Directory not empty error does not happens when using the gnu mv. Hardcoding the script to use gnu mv makes the nixos-rebuild switch successful! See: https://github.com/LuNeder/nixos-config/blob/324f1bc4d3180e8b6485a765c1b8c21360972c99/log-file-but-fixed-maybe

I once again made those scripts print the stat (and ls) of the stuff it’s messing with, before and after the mv command (uutils only has the before, because mv fails).

If it helps with the troubleshooting, here’s the complete script in which the problematic mv is located: https://github.com/LuNeder/nixos-config/blob/62092e522557eebe13946f5fa5a4b16b53faa6e0/suid-strt-troubleshoot#L168

Additionally, just like on the 6350 case, both /run/… paths are symbolic links to directories. And just like on that case, this problem does not happens at boot (when /run/wrappers/bin probably doesn’t exist yet) - it only happens when switching on a booted system (when that path does exist).

LuNeder added a commit to LuNeder/nixos-config that referenced this issue May 4, 2024
uutils/coreutils#6351
Tks Ben from uutils for helping me troubleshoot this (people on uutils discord are awesome tbh)
Also kudos to this person because I would NOT have the patience to compare the results between uutils and gnu: https://github.com/droberson/linux_amd64_static_tools
@BenWiederhake
Copy link
Collaborator

This affects any mv -T [anything] symlink-to-dir operation.

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

No branches or pull requests

2 participants