I'm having a hard time creating a simple hello world launch daemon. It is launched every 10 seconds and just logs "hello world" to the console. So I just compiled the Command Tool (Foundation) template of Xcode. Then I moved the product to /tmp/ and created a plist for launchd:
I loaded it into launchd using launchctl.
Launchd starts the process every 10 seconds, but it does not log "hello world". Also I keep getting this in the console:
So what's going wrong?
Code:
<?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>helloDaemon</string>
<key>ProgramArguments</key>
<array>
<string>/tmp/helloDaemon</string>
</array>
<key>StartInterval</key>
<integer>10</integer>
</dict>
</plist>
I loaded it into launchd using launchctl.
Launchd starts the process every 10 seconds, but it does not log "hello world". Also I keep getting this in the console:
Code:
11/03/2012 00:55:35.141 com.apple.launchd: (helloDaemon) Throttling respawn: Will start in 1 seconds
11/03/2012 00:55:45.141 com.apple.launchd: (helloDaemon) Throttling respawn: Will start in 2 seconds
11/03/2012 00:55:55.140 com.apple.launchd: (helloDaemon) Throttling respawn: Will start in 3 seconds
So what's going wrong?
Last edited: