[launchd-dev] Launch Agent and per-user launchd not exiting on logout (10.5.8)

Quinn "The Eskimo!" eskimo1 at apple.com
Mon Aug 23 02:31:45 PDT 2010

On 20 Aug 2010, at 21:03, Sidney San Martín wrote:

> I ran into a machine running OS 10.5.8 recently where our launchd
> agent and the user's launchd did not terminate at logout.

The per-user launchd does not necessarily quit at logout time.  Remember that the per-user launchd runs a variety of different sessions, so it will often remain running to manage those sessions.

OTOH the GUI session is supposed to be torn down at logout time, and that should quit your GUI per-user launchd agent.  This does work in general (even on 10.5 :-).  Can you think of any special about your agent that might be causing this?  Are you explicitly loading your agent?

If not, one trick I often use is to install TextEdit as a GUI per-user launchd agent.  This just requires you to create a minimal launchd property list file for TextEdit.  I can then use it to verify that launchd is behaving itself.  Once you do that, you should be able to compare your property list file to this dummy one, and your app to TextEdit, and see what's causing the problem.

Quinn "The Eskimo!"                    <http://www.apple.com/developer/>
Apple Developer Relations, Developer Technical Support, Core OS/Hardware

More information about the launchd-dev mailing list