LaunchAgent vs LaunchDaemon

When the system server is configured, why is it as a LaunchAgent instead of a LaunchDaemon? My understanding is that LaunchAgents are loaded only during a login session, and LaunchDaemons run in the background at all times and have no GUI. To get at the login screen before anyone has logged in, I'd assume it would have to be a LaunchDaemon.

From Apple's own page on launchd:
If your job needs to run even when no users are logged in, put it in /Library/LaunchDaemons. If it is only useful when users are logged in, put it in /Library/LaunchAgents.

Everything else of a server nature on my system runs as a LaunchDaemon; I'm curious as to why VineServer runs as a LaunchAgent instead.

Comments

  • JonathanOSXJonathanOSX ForumAdmin admin
    Well you basically answered the question yourself.
    LaunchDaemons ... have no GUI
    In our case although Vine Server doesn't DRAW to the GUI it must interact with the Window Server GUI interface (to read the screen) and this prevents it from working if we try to run it as a LaunchDaemon.

    It's also important because the System Server (by design) needs to extend across all user sessions and interact with the current console user.
  • Well you basically answered the question yourself.
    LaunchDaemons ... have no GUI
    In our case although Vine Server doesn't DRAW to the GUI it must interact with the Window Server GUI interface (to read the screen) and this prevents it from working if we try to run it as a LaunchDaemon.

    Ahhhh... that makes sense. Thank you for the illumination!
Sign In or Register to comment.