launchctl bootout fails for my own LaunchAgent: “caller is not allowed to signal target process”

I maintain a per-user LaunchAgent on my own Mac. Its plist is in ~/Library/LaunchAgents, and the service is registered in gui/501.

When my development tool invoked launchctl bootout, it exited with status 1. The macOS log said: “caller (PID 14105) is not allowed to signal target process.” I verified that the service label, domain, and plist matched the running agent. The agent is still running.

What requirements must the calling process meet to stop and re-register a LaunchAgent in the logged-in user’s GUI domain? Is there a read-only way to identify which restriction caused this denial before attempting to stop the service again?

Answered by DTS Engineer in 915346022

That message indicates that the signal that’s part of the bootout process was blocked by the sandbox. You wrote:

Written by RalphDev0215 in 856201021

When my development tool invoked launchctl bootout

Does your tool have the App Sandbox enabled? If so, you’ll want to disable that.

The other possibility is that your tool is be run in a third-party tool environment that uses a custom sandbox; if that’s the case, that’s not something we support. See this thread for the details.

Share and Enjoy
—
Quinn “The Eskimo!” @ Developer Technical Support @ Apple
let myEmail = "eskimo" + "1" + "@" + "apple.com"

That message indicates that the signal that’s part of the bootout process was blocked by the sandbox. You wrote:

Written by RalphDev0215 in 856201021

When my development tool invoked launchctl bootout

Does your tool have the App Sandbox enabled? If so, you’ll want to disable that.

The other possibility is that your tool is be run in a third-party tool environment that uses a custom sandbox; if that’s the case, that’s not something we support. See this thread for the details.

Share and Enjoy
—
Quinn “The Eskimo!” @ Developer Technical Support @ Apple
let myEmail = "eskimo" + "1" + "@" + "apple.com"