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

install-darwin: fix symbolic perms for install cmd #10001

Merged
merged 1 commit into from
Feb 13, 2024

Conversation

abathur
Copy link
Member

@abathur abathur commented Feb 13, 2024

Motivation

The symbolic form in use here doesn't seem to have an effect in either the BSD or coreutils install commands, leaving the daemon plist with empty permissions. This seems to cause its own problems.

I think I've got the right symbolic syntax now :)

I suspect this is the underlying cause in:

(But I'll reserve confidence until after I've used the generated installer, uninstalled, and reinstalled...)

Context

$ touch inst1
$ /usr/bin/install -m -rw-r--r-- inst1 inst2
$ ls -la inst*
-rw-r--r-- 1 abathur _lpoperator      0 Feb 12 12:19 inst1
---------- 1 abathur _lpoperator      0 Feb 12 12:21 inst2

 $ rm inst2

$ /usr/bin/install -m "u=rw,go=r" inst1 inst2

$ ls -la inst*
-rw-r--r-- 1 abathur _lpoperator      0 Feb 12 12:19 inst1
-rw-r--r-- 1 abathur _lpoperator      0 Feb 13 01:17 inst2

Priorities and Process

Add 👍 to pull requests you find important.

The Nix maintainer team uses a GitHub project board to schedule and track reviews.

The symbolic form in use here doesn't seem to have an effect
in either the BSD or coreutils install commands, leaving the
daemon plist with empty permissions. This seems to cause its
own problems.

I think I've got the right symbolic syntax now :)
@abathur abathur added installer macos Nix on macOS, aka OS X, aka darwin labels Feb 13, 2024
@runeksvendsen
Copy link
Contributor

For what it's worth, regarding #9969 I got the exact same error executing the sudo launchctl load /Library/LaunchDaemons/org.nixos.nix-daemon.plist command (Load failed: 5: Input/output error) after manually correcting the permissions for /Library/LaunchDaemons/org.nixos.nix-daemon.plist. But it's certainly the right thing to do regardless of whether it fixes that issue.

@abathur
Copy link
Member Author

abathur commented Feb 13, 2024

For what it's worth, regarding #9969 I got the exact same error executing the sudo launchctl load /Library/LaunchDaemons/org.nixos.nix-daemon.plist command (Load failed: 5: Input/output error) after manually correcting the permissions for /Library/LaunchDaemons/org.nixos.nix-daemon.plist. But it's certainly the right thing to do regardless of whether it fixes that issue.

I'm not really sure what's causing Nix LaunchDaemons to end up in the disabled service list, but once they are there it does seem like the problem will persist until they are removed from that list or enabled. Setting the perms alone would fix it at that point (even if my hunch about the cause is right--and I'm less confident now as I've tried a few times unsuccessfully to reproduce the problem on a spare macbook).

@Ericson2314
Copy link
Member

man install led me to man chmod, which confirmed this syntax. This seems legit.

@Ericson2314 Ericson2314 merged commit ee9f6d0 into NixOS:master Feb 13, 2024
10 checks passed
@abathur abathur deleted the fix_macos_daemon_perms branch February 13, 2024 22:48
tebowy pushed a commit to tebowy/nix that referenced this pull request Jul 11, 2024
install-darwin: fix symbolic perms for install cmd
(cherry picked from commit ee9f6d0)
Change-Id: I83240e1e93aa9a2ba34d5ac3abd8ef4f7ec54ac3
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
installer macos Nix on macOS, aka OS X, aka darwin
Projects
Archived in project
Development

Successfully merging this pull request may close these issues.

3 participants