docs:mac:launchd

This is an old revision of the document!


launchd

Mac OS X provides two methods for launching daemons: startup items and launchd(8) daemons. Which one you use depends largely on the versions of Mac OS X that the daemon must support.

  • Mac OS X v10.3 and earlier: You must use startup items. The launchd service is not supported prior to v10.4.
  • Mac OS X v10.4 and earlier: You can either use startup items or launchd daemons. Using launchd daemons is preferred unless you also require backwards compatibility with versions of Mac OS X prior to v10.4.
  1. open Property List Editor (included in Developer Tools)
  2. create entries in a new file as shown in examples below
  3. save the file to ~/Library/LaunchAgents/<namespaced filename, such as com.example.MyApp.plist>
  4. add the file to launchd in the Terminal
    launchctl load Library/LaunchAgents/com.example.MyApp.plist

local.Apache2.plist

  • Root dictionary
    • Label (string): Apache2
    • ProgramArguments (array):
      • (string): /usr/local/apache2/apachectl start
    • OnDemand (boolean): false
  • docs/mac/launchd.1302931615.txt.gz
  • Last modified: 2011/04/15 23:26
  • by billh