Skip to content

ensure-container-stopped.sh: don't fail on launchctl errors - #1461

Merged
jglogan merged 1 commit into
apple:mainfrom
p-linnane:fix/ensure-stopped-launchctl-errors
Apr 30, 2026
Merged

ensure-container-stopped.sh: don't fail on launchctl errors#1461
jglogan merged 1 commit into
apple:mainfrom
p-linnane:fix/ensure-stopped-launchctl-errors

Conversation

@p-linnane

Copy link
Copy Markdown
Contributor

Type of Change

  • Bug fix
  • New feature
  • Breaking change
  • Documentation update

Motivation and Context

Fixes #1281. Supersedes #1306.

When -a runs as a regular user (such as via brew install container), two launchctl failures bubble up as a non-zero exit and break Homebrew's post-install:

  • bootout against system requires root.
  • launchctl print lists Mach endpoint names that aren't loaded jobs, so bootout returns No such process on them.

Skip system when not root, and treat individual bootout failures as non-fatal. Same fix applied to the non--a xargs pipeline.

Testing

  • Tested locally
  • Added/updated tests
  • Added/updated docs

Signed-off-by: Patrick Linnane <patrick@linnane.io>
@p-linnane

Copy link
Copy Markdown
Contributor Author

@jglogan I've validated this against our formula in Homebrew/core and confirm brew postinstall succeeds as expected.

@jglogan
jglogan merged commit fd2de35 into apple:main Apr 30, 2026
4 checks passed
@jglogan

jglogan commented Apr 30, 2026

Copy link
Copy Markdown
Contributor

Thanks, Patrick! Merged.

noah-thor pushed a commit to noah-thor/container that referenced this pull request May 6, 2026
- Fixes apple#1281. Supersedes apple#1306.
- When `-a` runs as a regular user (such as via
  `brew install container`), two launchctl failures
  bubble up as a non-zero exit and break Homebrew's
  post-install:
  - `bootout` against `system` requires root.
  - `launchctl print` lists Mach endpoint names that
    aren't loaded jobs, so `bootout` returns
    `No such process` on them.
- Skip `system` when not root, and treat individual
  `bootout` failures as non-fatal. Same fix applied to
  the non-`-a` `xargs` pipeline.

Signed-off-by: Patrick Linnane <patrick@linnane.io>
jianliang00 pushed a commit to jianliang00/container that referenced this pull request Aug 28, 2026
- Fixes apple#1281. Supersedes apple#1306.
- When `-a` runs as a regular user (such as via
  `brew install container`), two launchctl failures
  bubble up as a non-zero exit and break Homebrew's
  post-install:
  - `bootout` against `system` requires root.
  - `launchctl print` lists Mach endpoint names that
    aren't loaded jobs, so `bootout` returns
    `No such process` on them.
- Skip `system` when not root, and treat individual
  `bootout` failures as non-fatal. Same fix applied to
  the non-`-a` `xargs` pipeline.

Signed-off-by: Patrick Linnane <patrick@linnane.io>
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.

[Bug]: Boot-out failed: 1: Operation not permitted (Installing via hoomebrew)

2 participants