You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
{{ message }}
Repository navigation
homebrew: Restarting services does not work when darwin-rebuild is run from launchd daemon #1821
Hi there, I've built a tool to watch a git repo and run darwin-rebuild on changes. Unfortunately I get an error when the homebrew module tries to restart a brew service.
In my nix-darwin config I've added node_exporter via homebrew:
I'm able to run darwin-rebuild without any problem by hand, but as soon as I run it via my tool (pulld), I receive this error:
Using node_exporter
Installing node_exporter has failed!
`brew bundle` failed! 1 Brewfile dependency failed to install
Warning: running through sudo, using user/* instead of gui/* domain!
Hide this warning by setting `HOMEBREW_SERVICES_NO_DOMAIN_WARNING=1`.
Hide these hints with `HOMEBREW_NO_ENV_HINTS=1` (see `man brew`).
Bootstrap failed: 5: Input/output error
Try re-running the command as root for richer errors.
Error: Failure while executing; `/bin/launchctl bootstrap user/501 /Users/admin/Library/LaunchAgents/homebrew.mxcl.node_exporter.plist` exited with 5.
Now when I stop the service (brew services stop node_exporter) pulld works until I run darwin-rebuild by hand again or restart the computer.
I'm a bit confused about this since I run darwin-rebuild with sudo and the pulld service runs as root.
changed the title [-]homebrew: Restarting services does not work when darwin-rebuild is run from launchd daemon[/-][+]homebrew: Restarting services does not work when `darwin-rebuild` is run from launchd daemon[/+]on Jul 6, 2026
Activity
[-]homebrew: Restarting services does not work when darwin-rebuild is run from launchd daemon[/-][+]homebrew: Restarting services does not work when `darwin-rebuild` is run from launchd daemon[/+]