i have a problem when i run LaunchDaemons this is my .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>
and this is the error am getting, i have been trying to solve this issue for hours but no suceess :(
when i checked system log this is what i found:
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.
Your plist looks running shell script. Exit code 127 is reported when command is not found, usually $PATH is not correct or just by typo.
Other than that, your plist looks ok though I have only used OnDemand, and I haven't run script. What I usually do to debug daemons is to run them from command line
and see debug messages by fprintf on shell. You can redirect your stdout by adding
to your .plist. Does your daemon work w/o any issue when started by command line manually ?
See this link for exit codes of scripts of bash.