daemon-child dies on user lougout
site_archiver@lists.apple.com Delivered-To: Darwin-dev@lists.apple.com User-agent: Thunderbird 2.0.0.17 (Macintosh/20080914) Hi, I'm picking up on a thread called 'launchd daemon, spawning children?'. One last question: If "worker_user" is the current GUI-user, all his applications get killed on logout. Is there a way around this (or would using 'login' also solve this issue?) Seems only logical. But I have an odd behavior there, my application dies on user-logout. Here is the scenario: - daemon is running as root - daemon fork()s a child, that setuid()s to some user - child exec()s some worker program - worker connects on a socket to the daemon, using ICE (www.zeroc.com) - if the worker runs as current GUI user, and that user logs out, the worker dies/crashes. - if the worker runs as any other system user, all works fine. ReportCrash saves a report similar to the one attached. The only thing my child and server are doing are the network connection, and some disk usage. When I use a dummy worker that does nothing (sleeps), it doesn't die (and gets no SIGTERM or SIGHUP sent, as Terry already predicted). So I can only imagine that the logout kills the ICE socket connection for that user? Does that make any sense to anyone? Cheers, Mario _______________________________________________ Do not post admin requests to the list. They will be ignored. Darwin-dev mailing list (Darwin-dev@lists.apple.com) Help/Unsubscribe/Update your Subscription: http://lists.apple.com/mailman/options/darwin-dev/site_archiver%40lists.appl... Terry Lambert wrote: On Oct 1, 2008, at 3:40 AM, Mario Emmenlauer wrote: The logout operation for non-GUI applications sends either a SIGHUP (the correct signal), or a SIGTERM (not the correct signal). You can ignore or catch these signals with a signal handler, although if you ignore SIGTERM, you will delay shutdowns. In general, daemons running as that user are not kiplled unless they are in the process group, or their parent is the per-session launchd. Otherwise, you would not be able to ssh into a machine and log out of a GUI and not have it kill your ssh (which it doesn't do). This email sent to site_archiver@lists.apple.com
participants (1)
-
Mario Emmenlauer