launchctl bootout on macOS Sonoma is failing with EIO = "Input/output error"

35 Views Asked by At

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>
1

There are 1 best solutions below

2
Philippe On

Try to unload first :

/bin/launchctl unload /Library/LaunchAgents/com.company.name.plist