You need to enable JavaScript to run this app.
优惠活动
大模型
产品
解决方案
定价
更多

macOS Ventura 13.0执行launchctl bootstrap报错134求助

解决macOS Ventura 13.0中Launchctl Bootstrap报错134的问题

问题还原

执行命令:

sudo launchctl bootstrap user/501 ~/Library/LaunchAgents/io.mutagen.mutagen.plist

出现错误:

/Users/simanta/Library/LaunchAgents/io.mutagen.mutagen.plist: Service cannot load in requested session
Bootstrap failed: 134: Service cannot load in requested session

plist文件内容:

<?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>Label</key>
    <string>io.mutagen.mutagen</string>
    <key>ProgramArguments</key>
    <array>
        <string>/usr/local/bin/mutagen</string>
        <string>daemon</string>
        <string>run</string>
    </array>
    <key>LimitLoadToSessionType</key>
    <string>Aqua</string>
    <key>KeepAlive</key>
    <true/>
</dict>
</plist>

报错原因

  1. 错误使用sudo:LaunchAgents是用户级服务配置,无需sudo执行。sudo会切换到root环境,无法访问当前用户的图形会话(Aqua)。
  2. 会话类型不匹配:plist指定LimitLoadToSessionType为Aqua(图形化用户会话),但命令中使用的user/501对应非图形化用户会话,两者不兼容。

解决方案

执行以下命令(不要加sudo):

launchctl bootstrap gui/501 ~/Library/LaunchAgents/io.mutagen.mutagen.plist
  • gui/501是macOS Ventura及后续版本中,对应用户图形化会话的正确标识,与plist中的Aqua会话类型匹配。
  • 验证服务是否启动:
launchctl list io.mutagen.mutagen

额外检查项

  • 确认/usr/local/bin/mutagen路径存在且当前用户有执行权限:
ls -l /usr/local/bin/mutagen
  • 若需重启服务,先卸载再重新加载:
launchctl bootout gui/501/io.mutagen.mutagen
launchctl bootstrap gui/501 ~/Library/LaunchAgents/io.mutagen.mutagen.plist

内容的提问来源于stack exchange,提问作者psimanta

相关产品推荐
方舟 Agent Plan

超全模态模型 × Harness 升级,最新支持 Deepseek-V4.1-Flash、GLM-5.3 系列、Doubao-Seedream-5.0-pro、Kimi-K3 (部分), 限时 9.9 元起

最近更新时间:2026.08.04 00:25:54