Skip to content

[macOS 27] --restart-service removes working registration, then SMAppService re-registration fails code-sign validation #53

Description

@TyceHerrman

Describe the bug

With skhd.zig v0.2.0 installed through the Homebrew cask, --restart-service removed an existing working com.jackielii.skhd registration but failed to register the bundled LaunchAgent again.

Subsequent --start-service / --install-service attempts fail with:

SMAppService.register failed:
Codesigning failure loading plist: com.jackielii.skhd.plist
code: -2147409622

The machine is then left without a registered or running service. Before the restart, the daemon was running and hotkeys worked.

To reproduce

  1. Install jackielii/tap/skhd-zig through Homebrew.

  2. Have an existing com.jackielii.skhd service registration.

  3. Run:

    /Applications/skhd.app/Contents/MacOS/skhd --restart-service
  4. Registration fails with the code-signing error above.

  5. Running --start-service again produces the same failure.

I have not reproduced this with a clean macOS user account; this occurred while reconciling an existing registration.

Current status

Service installed:    No
Registration status:  bundled plist not found
Daemon running:       No (LaunchAgent not loaded)

The bundled plist is present and valid:

$ plutil -lint /Applications/skhd.app/Contents/Library/LaunchAgents/com.jackielii.skhd.plist
/Applications/skhd.app/Contents/Library/LaunchAgents/com.jackielii.skhd.plist: OK

The unmodified Homebrew app does not pass strict signature verification:

$ codesign --verify --deep --strict --verbose=4 /Applications/skhd.app
/Applications/skhd.app: CSSMERR_TP_NOT_TRUSTED
In architecture: arm64

Relevant signature details:

Identifier=com.jackielii.skhd
Authority=(unavailable)
TeamIdentifier=not set

Gatekeeper assessment also reports:

/Applications/skhd.app: internal error in Code Signing subsystem

Expected behavior

--restart-service should either successfully restore the registration or preserve the existing working registration when re-registration fails.

Is the Homebrew-distributed app expected to register through SMAppService without users locally re-signing it? If local self-signing is required, could that requirement be automated or documented for Homebrew installations and upgrades?

I saw that PR #42 explicitly accepted the lack of Developer ID signing/notarization. Developer ID signing may be one long-term solution, but I am primarily reporting the failure of the currently documented service flow rather than requesting a particular implementation.

Related:

Environment

  • macOS 27.0 beta, build 26A5388g
  • Apple Silicon
  • Homebrew cask: skhd-zig 0.2.0
  • skhd.zig: v0.2.0-7e95d99 (fast)
  • No skhd-grabber, .remap, or .taphold configuration

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions