我在运行 LaunchDaemons 时遇到问题,这是我的 .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>com.startup</string>
<key>ProgramArguments</key>
<array>
<string>/Users/myuser/project/workspace/tomcat/run/tomcat-
exp.sh</string>
</array>
<key>RunAtLoad</key>
<true/>
<key>WatchPaths</key>
<array>
<string>/Users/myuser/project/workspace/tomcat/log/exp.out</string>
</array>
</dict>
</plist>
这就是我遇到的错误,我已经尝试解决这个问题几个小时但没有成功:(
当我检查系统日志时,这是我发现的:
16239 Dec 28 21:36:29 myyser MRT[1481]: Error: SMJobRemove: The
operation couldn’t be completed. (CFErrorDomainLaunchd error 2.)
16240 Dec 28 21:36:29 myuser com.apple.xpc.launchd[1]
(com.apple.mrt[1481]): Service exited with abnormal code: 2
16241 Dec 28 21:36:29 myuser com.apple.xpc.launchd[1] (com.apple.mrt):
Service only ran for 0 seconds. Pushing respawn out by 10 seco
nds.