What exactly are these "domain" and "service targets" and how do I associate them with plists for use by launchd?
OS X 10.10 introduces a new
launchctl API for managing LaunchDaemons and launching plists. Log messages and man pages suggest that keys like
RunAtLoad should no longer be used and that subcommands
kickstart should be used in preference to
load -w and
However it is not clear from the man pages how to associate a plist with the "domain" and "service target" it talks about and without which these commands cannot be used with existing plists that seemingly were quite sufficient for OS X 10.9
For example [updated]: A basic plist we are trying to "launch"; seemingly bootstrapped into "system" domain but subsequently not recognised in "system"
# pwd /Library/LaunchDaemons # cat com.iainhouston.django.plist <?xml version="1.0" encoding="UTF-8"?> <!DOCTYPE plist PUBLIC -//Apple Computer//DTD PLIST 1.0//EN http://www.apple.com/DTDs/PropertyList-1.0.dtd > <plist version="1.0"> <dict> <key>Label</key> <string>com.iainhouston.django</string> <key>ProgramArguments</key> <array> <string>/usr/local/virtualenvs/django.iainhouston.com/bin/gunicorn</string> <string>--bind=127.0.0.1:49202</string> <string>--workers=2</string> <string>superlists.wsgi:application</string> </array> <key>Disabled</key><false/> </dict> </plist> # launchctl bootstrap system com.iainhouston.django.plist /Library/LaunchDaemons/com.iainhouston.django.plist: Service is disabled # launchctl enable system/com.iainhouston.django.plist # launchctl kickstart system/com.iainhouston.django.plist Could not find service "com.iainhouston.django.plist" in domain for system
The system log records that
launchctl -w load ... complains when we use
RunAtLoad that This service is defined to be constantly running and is inherently inefficient. so we are motivated to use the new interface.
Not only that, we have significant problems with excessive processor usage that we want to control by providing the appropriate on-demand keywords so, again, we are motivated to understand how to interact with the new launchd .... not easy with the docs as they stand!