Skip to content

bundle/brew_services: tolerate missing launchctl/systemctl#21828

Open
branchv wants to merge 1 commit intoHomebrew:mainfrom
branchv:brew-services
Open

bundle/brew_services: tolerate missing launchctl/systemctl#21828
branchv wants to merge 1 commit intoHomebrew:mainfrom
branchv:brew-services

Conversation

@branchv
Copy link
Copy Markdown
Member

@branchv branchv commented Mar 25, 2026


  • Have you followed the guidelines in our Contributing document?
  • Have you checked to ensure there aren't other open Pull Requests for the same change?
  • Have you added an explanation of what your changes do and why you'd like us to include them?
  • Have you written new tests (excluding integration tests) for your changes? Here's an example.
  • Have you successfully run brew lgtm (style, typechecking and tests) with your changes locally?

  • AI was used to generate or assist with generating this PR. Please specify below how you used AI to help you, and what steps you have taken to manually verify the changes.

Different approach to fix #21720 by not treating a missing systemctl as a fatal error, which I found surprising

See also #21722 (comment)

Copilot AI review requested due to automatic review settings March 25, 2026 04:30
Copy link
Copy Markdown
Contributor

Copilot AI left a comment

Choose a reason for hiding this comment

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

Pull request overview

Adjusts brew bundle’s service introspection to no longer fail on systems where brew services isn’t supported (e.g., Linux without systemd), aligning bundle dump behavior with “best-effort” service detection.

Changes:

  • Return an empty started-services list when neither launchctl nor systemctl is available (instead of exiting).
  • Update the brew_services spec to expect an empty array in the no-daemon-manager case.

Reviewed changes

Copilot reviewed 2 out of 2 changed files in this pull request and generated 2 comments.

File Description
Library/Homebrew/bundle/brew_services.rb Makes started_services tolerate missing service managers by returning [].
Library/Homebrew/test/bundle/brew_services_spec.rb Updates expectations to match the new non-fatal behavior.

💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.

Copy link
Copy Markdown
Member

@carlocab carlocab left a comment

Choose a reason for hiding this comment

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

Thanks!

Copy link
Copy Markdown
Member

@MikeMcQuaid MikeMcQuaid left a comment

Choose a reason for hiding this comment

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

Thanks! One thought.

Copy link
Copy Markdown
Member

@MikeMcQuaid MikeMcQuaid left a comment

Choose a reason for hiding this comment

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

Looks good but sorry more ideas here.

odie Homebrew::Services::System::MISSING_DAEMON_MANAGER_EXCEPTION_MESSAGE
end
@started_services ||= if !Homebrew::Services::System.launchctl? && !Homebrew::Services::System.systemctl?
opoo "Skipping `brew services list` due to missing launchctl/systemctl"
Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

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

Sorry, I know this is annoying:

  • a missing launchctl basically never happens
  • a missing systemctl is very common in some Linux environments

As a result, I think this should be OS-specific behaviour where we odie on macOS and opoo on Linux.

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.

bundle dump fails on Linux without systemd

5 participants