3

I would like to know in what order services and applications are started in OS X (Mountain) Lion from startup folders like:

/Library/LaunchAgents
/Library/LaunchDaemons
/System/Library/LaunchAgents
/System/Library/LaunchDaemons
~/Library/LaunchAgent
/Library/StartupItems
/System/Library/StartupItems
2
  • 2
    Belongs in Super User
    – Cole Tobin
    Sep 6, 2012 at 14:49
  • 3
    apple.stackexchange.com would be a better choice.
    – Wooble
    Sep 6, 2012 at 14:50

1 Answer 1

3

/System/Library/LaunchDaemons, /Library/LaunchDaemons, and /Library/StartupItems are all processed at system startup. There's no specific order to the LaunchDaemons folders -- everything in them becomes eligible to run all at once, only those with <key>RunAtLoad</key><true/> actually launch immediately. The launchd way of doing things is to fire 'em all off and let them sort out their own dependencies.

StartupItems (if there are any) define their own order. Each StartupItem is a folder that includes the script to run, and a StartupParameters.plist file that (among other things) can define what the StartupItem provides, and what it requires; they will be ordered so that the item that provides a particular capability run before those that require it.

I'd expect StartupItems to run after RunAtLoad LaunchDaemons, but I don't think that's specified anywhere and I wouldn't count on it.

The items in the three LaunchAgent folders are all loaded when a user logs in (i.e. sometime after system startup). As with LaunchDaemons, there's no particular order, they all become eligible to run at the same time.

Finally, there is no /System/Library/StartupItems folder in OS X Lion.

You must log in to answer this question.