I have service application that I created using the empty service template.
I’m currently running on mac.
It uses a timer currently set to 10 seconds (will be 60 seconds after I get it all set up) When the timer fires, it logs on to a server, downloads some information and processes it then sends the information to a serial device.
I have a plist setup to handle launching at startup and hopefully keeping running in background: /Library/LaunchDaemons/myapp/com.myapp.plist
I have two problems:
I can’t seem to get the app to load automatically on startup. But I can get it to launch from terminal using: “launchctl load -w /Library/LaunchDaemons/com.myapp.plist”
Once I use launchctl to load the plist, the service does launch but then it duplicates itself (as I observe in the Activity Monitor app). As you may guess the service duplicates itself eveytime the timer fires, in this case every 10 seconds.
Does anyone have suggestions as to how to deal with these two problems?
Below is the text from the plist file
[code]<?xml version="1.0" encoding="UTF-8"?>Label com.myapp OnDemand ProgramArguments /Library/Application Support/myapp/myapp start RunAtLoad UserName root [/code]