Educate me on where all start up items exist in OS X (Lion)

Discussion in 'macOS' started by lokiju, Sep 9, 2011.

  1. lokiju macrumors 6502

    Joined:
    Jun 10, 2008
    #1
    I was a Windows only guy for many many years and have been using Macs now for about 3 years full time for personal user and at my prior job it's all I used as well for work.

    I'm a Sr Systems Engineer however and still work on Windows servers as 95% of my day to day.

    I'm trying to understand the way things get called or added to be started up when OS X boots.

    I know in Windows for example, there are a number of locations this can be defined. There's a users start up folder, there's a system wide (all users) start up folder, there are spots in the registry, and there are services.

    I'm looking to understand at that kind of level but with OS X where any an all daemons (services) and apps get called to start on boot so I can get a better understanding of what's happening and ensure there aren't items that I do not wish to start with the OS each time.

    Maybe there's even a built in function to find this out or a 3rd party app that makes seeing this info and managing it easier.

    Thanks!
     
  2. Hansr macrumors 6502a

    Joined:
    Apr 1, 2007
    #2
    Excluding all kernel and kext loading:

    The user defined in System Prefs or Dock are stored in the perspective users preferences as defined in System Prefs or checked in the Dock.

    The stuff you are looking for is from man launchd:
    ~/Library/LaunchAgents
    Per-user agents provided by the user.
    /Library/LaunchAgents
    Per-user agents provided by the administrator.
    /Library/LaunchDaemons
    System-wide daemons provided by the administrator.
    /System/Library/LaunchAgents
    Per-user agents provided by Mac OS X.
    /System/Library/LaunchDaemons
    System-wide daemons provided by Mac OS X.

    Plus /etc/rc IIRC.

    ----------

    Found this for the pre user access stuff:
    http://osxbook.com/book/bonus/ancient/whatismacosx/arch_startup.html

    + kernel:
    http://osxbook.com/book/bonus/ancient/whatismacosx/arch_boot.html
     
  3. lokiju thread starter macrumors 6502

    Joined:
    Jun 10, 2008
    #3
    Thank you!
     
  4. larkost macrumors 6502a

    Joined:
    Oct 13, 2007
    #4
    A more complete list, roughly in order of being launched on an auto-login system:

    1. /etc/mach_init.d/
    2. /etc/rc/ and /etc/rc.local - totally unsupported, and not created by default (but probably still work)
    3. LaunchDaemons (run at system startup, default to root user) in /Library/LaunchDaemons and /System/Library/LaunchDaemons (possibly /Network/Library/LaunchDaemons, but I don't know)
    4. /etc/mach_init_per_login_session.d/ and /etc/mach_init_per_user.d/
    5. (old) /Library/StartupItems, /Network/Library/StartupItems, /System/Library/StartupItems - probably does not work anymore
    6. cron launched @reboot items (yes, cron is still there), this might even work for everyone's crontabs
    7. /Library/Security/SecurityAgentPlugins that have been loaded by being listed in the proper spots in /etc/authorization
    8. /private/var/root/Library/Preferences/com.apple.loginwindow.plist, in the LoginHook key (runs as root, passed the username)
    9. MCX (WorkgroupManager) login hooks (runs as root, but passed the username)
    10. note: below this network home directories are more reliably available, as is a connection to the WindowsServer
    11. LaunchAgents (run at login, generally in the user's space) in ~/Library/LaunchAgents, /Library/LaunchAgents, /Network/Library/LaunchAgents and /System/Library/LaunchAgents
    12. MenuBar items from ~/Library/Preferences/com.apple.systemuiserver.plist and /Library/Preferences/com.apple.systemuiserver.plist (+MXC added items)
    13. /Library/Preferences/loginwindow.plist, in the key (array of paths) AutoLaunchedApplicationDictionary (everyone gets this launched at login, runs as user) (+MXC added items)
    14. LoginItems (generally GUI items) ~/Library/Preferences/com.apple.loginitems.plist and possibly /Library/Preferences/com.apple.loginitems.plist (have not tried) (+MXC added items)
     
  5. darrennie macrumors newbie

    darrennie

    Joined:
    Aug 21, 2010
    Location:
    Just over the horizon
    #5
    2.5 Years to late... but thanks for the info.
     
  6. lokiju thread starter macrumors 6502

    Joined:
    Jun 10, 2008
    #6
    I received notification for this late reply but thought I'd add that I've been using the app Lingon lately for my Macs to manage startup items and scripts.

    It's a simple but handy tool that lets you define a number of startup related parameters beyond the login items under Settings>users.

    I have nothing to do with the dev or app but just thought I'd share.

    http://www.peterborgapps.com/lingon/
     

Share This Page