2

My macOS app stopped working on macOS 14.4.1 (Kernel: Darwin v.23.4.0), or "Sonoma". I started looking into it, and it turns out that when I try to remove my launch agent:

/bin/launchctl bootout gui/501 /Library/LaunchAgents/com.company.name.plist

launchctl fails for bootout with error code 5, or EIO = "Input/output error"

Is it something new to Sonoma, or what is the issue there? It used to work on previous versions of macOS.

Note that the Mach-O executable for the launch agent is properly signed and notarized with the Apple portal.

The .plist in question goes as such:

<?xml version="1.0" encoding="UTF-8"?>
<!DOCTYPE plist PUBLIC "-//Apple//DTD PLIST 1.0//EN" "http://www.apple.com/DTDs/PropertyList-1.0.dtd">
<plist version="1.0">
<dict>
    <key>com.company.name.launch.agent</key>
    <true/>
    <key>LimitLoadToSessionType</key>
    <array>
        <string>LoginWindow</string>
        <string>Aqua</string>
    </array>
    <key>Disabled</key>
    <false/>
    <key>Label</key>
    <string>com.company.name</string>
    <key>Program</key>
    <string>/Library/PrivilegedHelperTools/com.company/name</string>
    <key>ProgramArguments</key>
    <array>
        <string>-a</string>
    </array>
    <key>RunAtLoad</key>
    <true/>
    <key>KeepAlive</key>
    <true/>
</dict>
</plist>

3 Answers 3

5

Try to unload first :

/bin/launchctl unload /Library/LaunchAgents/com.company.name.plist
Sign up to request clarification or add additional context in comments.

3 Comments

Thanks. I'm wondering, is it something that they introduced in Sonoma, or was I doing it wrong before?
It's actually the opposite. launchctl load | unload are both deprecated. They still work but the more modern way is to use bootstrap/bootout. I'm trying to get used to the new way but I've found it to be much more fiddly.
@c00000fd Did this fix the problem? If yes, feel free to accept the answer.
3

Alternatively you can do the following:

  1. Lists information about services. In Terminal:
/bin/launchctl list
  1. Find the mongodb service by search of the list by the word mongodb. In my case it was homebrew.mxcl.mongodb-community

  2. Unload the specified service name. In Terminal:

/bin/launchctl remove homebrew.mxcl.mongodb-community

Comments

1

Make sure your plist file (/Library/LaunchAgents/com.company.name.plist) has ownership root:wheel.

1 Comment

simple but crucial point

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.