Take the 2-minute tour ×
Super User is a question and answer site for computer enthusiasts and power users. It's 100% free, no registration required.

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
share|improve this question
2  
Belongs in Super User –  Cole Johnson Sep 6 '12 at 14:49
3  
apple.stackexchange.com would be a better choice. –  Wooble Sep 6 '12 at 14:50
add comment

migrated from stackoverflow.com Sep 6 '12 at 19:58

This question came from our site for professional and enthusiast programmers.

1 Answer

/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.

share|improve this answer
add comment

Your Answer

 
discard

By posting your answer, you agree to the privacy policy and terms of service.