I am no stranger to launchd on OS X. I've created several daemons in the past, last with Mountain Lion Mavericks.
However, I seem to be struggling to get the most simplest of plists working on Mavericks and El Capitan. Initially, I copied my plist that runs Tomcat and modified it to get WebSphere Liberty Profile running at startup. After seeing some errors, I decided to try the following example plist from Apple's own [site]. The following doesn't even run:
<?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.example.hello</string> <key>ProgramArguments</key> <array> <string>hello</string> <string>world</string> </array> <key>KeepAlive</key> <true/> </dict>
Whenever I place the plist file in /Library/LaunchDaemons and then load the plist, I see the following errors in Console:
10/5/15 11:52:44.868 AM com.apple.xpc.launchd: (com.example.hello) This service is defined to be constantly running and is inherently inefficient.
10/5/15 11:52:44.869 AM com.apple.xpc.launchd: (com.example.hello) Service could not initialize: 15A284: xpcproxy + 12644 [19011403-4854-3CCD-9FCF-49C36302EB40]: 0x2
10/5/15 11:52:44.870 AM com.apple.xpc.launchd: (com.example.hello) Service only ran for 0 seconds. Pushing respawn out by 10 seconds.
And that's it as far as output. I've tried writing to a StandardOutput and StandardError log, but the log files are empty.
Being as I'm seeing this situation occur on both Yosemite and El Capitan, I thought that it must be something with permissions:
-rw-r--r-- 1 root wheel 418 Oct 5 11:52 helloworld.plist
However, I've tried running the daemon with permissions set to 644 and 755, but I still see the same Console error.
Am I overlooking something?