site_archiver@lists.apple.com Delivered-To: darwin-dev@lists.apple.com User-agent: Microsoft-Entourage/10.1.6.040913.0 By the way, the triple-posting of my original message didn't come from me. According to the headers of the duplicates, someone else re-sent my message twice. I guess we'll see if it happens again for this message. :-) circa 2/1/05 12:16 PM, "Graham J Lee" <leeg@teaching.physics.ox.ac.uk> wrote:
Does the user's .logout script (or whatever alternative bash has) get run when they log out of the console environment? If so, you launch your daemon from .login, and cause it to write its pid into ~/.mydaemonname.pid, and then .logout contains the line "kill -QUIT `cat ~/.mydaemonname.pid`".
If this script does run, and I doubt it does since typically such things are only run as part of a terminal session, I can't really exploit this reasonably because such scripts are arbitrarily complex and thus very difficult to reliably modify programmatically (especially on uninstall), and our users have no command-line expertise so can't do it themselves.
Of course, if it doesn't get run, then you probably need to use a logouthook. But that would make you a customer of the WindowServer, which you don't want (understandably, because then users who ssh in don't get to kill their daemons).
I got an additional message off-list containing a link to a page on logout hooks. http://developer.apple.com/documentation/ MacOSX/Conceptual/BPSystemStartup/Tasks/CustomLogin.html I read this far and stopped: you must modify the code for launching loginwindow found in /etc/ttys Wow. I am definitely not in a position to do that. I suppose I should consider kAEQuitApplication, but I am not sure how I am going to listen to that without attaching to the window server. I have heard there are lower-level ways to do Apple events, but I have never used them. -- Pete Gontier http://www.m-audio.com/ _______________________________________________ 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... This email sent to site_archiver@lists.apple.com