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

Rollback is not executable on MacOS #139

Open
benedictdaske opened this issue Jan 8, 2025 · 1 comment
Open

Rollback is not executable on MacOS #139

benedictdaske opened this issue Jan 8, 2025 · 1 comment

Comments

@benedictdaske
Copy link

Hey there,

So it seems the permissions for executing a rollback seem to be wrongly configured.

sudo nix run .#rollback leads to:

Running rollback for aarch64-darwin /nix/store/apw6xiz22d4hr5rz687yvy4v0nih23jd-rollback/bin/rollback: line 4: /nix/store/hcf07hxx5bdgzzfn85184zsd8sdan8is-source/apps/aarch64-darwin/rollback: Permission denied /nix/store/apw6xiz22d4hr5rz687yvy4v0nih23jd-rollback/bin/rollback: line 4: exec: /nix/store/hcf07hxx5bdgzzfn85184zsd8sdan8is-source/apps/aarch64-darwin/rollback: cannot execute: Undefined error: 0

When i look at the permissions of each of the management commands, I discovered:

-r-xr-xr-x 1 root nixbld 4746 Jan 1 1970 apply -r-xr-xr-x 1 root nixbld 431 Jan 1 1970 build -r-xr-xr-x 1 root nixbld 550 Jan 1 1970 build-switch -r--r--r-- 1 root nixbld 609 Jan 1 1970 rollback

Which indicates, no user is able to run the rollback. Would it mess with the config if I manually chmod the permissions to be the same as for the other scripts?
Also is there any point, this is configured in the setup? I haven't managed to find anything hinting that way...

Is this a me problem, or can someone else replicate the problem?

Cheers!

@benedictdaske benedictdaske changed the title Rollback is not executable Rollback is not executable on MacOS Jan 8, 2025
@benedictdaske
Copy link
Author

benedictdaske commented Jan 8, 2025

Found the solution, there is a small error in the README, preventing the rollback from being executable later on.

Step 4 of the README to make apps executable is missing the rollback. So instead of:

find apps/$(uname -m | sed 's/arm64/aarch64/')-darwin -type f \( -name apply -o -name build -o -name build-switch -o -name create-keys -o -name copy-keys -o -name check-keys \) -exec chmod +x {} \;

the correct command should be:

find apps/$(uname -m | sed 's/arm64/aarch64/')-darwin -type f \( -name apply -o -name build -o -name build-switch -o -name create-keys -o -name copy-keys -o -name check-keys -o -name rollback \) -exec chmod +x {} \;

Can't PR without forking unfortunately, so I'll leave that to the owner!

@dustinlyons Just so you know, that's what's causing the problem (:

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

No branches or pull requests

1 participant