Mailing Lists: Apple Mailing Lists

Image of Mac OS face in stamp
 
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: Background app running as root and logout process



Hi Robert,

Since this involves Carbon and the window server, your questions are marginally related to Darwin. ;-)

The window server will kill all of its clients at logout time. Period. That's because the window server itself will terminate and restart when the user logs out. That ensures that no process started by one user can potentially listen for events (like password keystrokes) generated by the next user. (The window server handles event dispatching as well as window management.)

There were some changes in this area for Panther, but the classic solution has been for a startup item that does not use the window server to use System Configuration to watch for logouts and relaunch the BOA at that time.

I don't think this is documented anywhere yet, although one of my DTS colleagues keeps threatening to...perhaps if you wrote DTS he'd give an answer for free since the issues are well-understood and no additional research would be necessary.

Thanks,
--gc

On Feb 26, 2004, at 3:00 PM, Robert Fab wrote:

Hello everybody,

I have a tool application which runs as a daemon on
startup. It just links against CoreServices framework
and installs a notifier for the login event. When it
detects a login, it launches another application. This
second one will run as a background-only app (BOA) and
it links against Carbon framework. Both run as root.

The BOA calls RunApplicationEventLoop to install a
standard event handler.

My problem is that running in Mac OS 10.3.2, after a
user logout, the loginwindow process tries to quit my
BOA and it can't. The Console shows me this alert:

"login window: sendQuitEventToApp (myApp):
AESendWithMach returned error -1712"

The -1712 error means time out. After that, my BOA is
killed.

This is understandable because the BOA is running as
root and loginwindow as the logged user.

I have seen a different behavior on early Jaguar
versions like 10.2.3, where the BOA replied to the
quit apple event.

I don't want my BOA get killed because I need to do
some post-processing after RunApplicationEventLoop
call. Some ideas?

Thanks in advance ...



__________________________________
Do you Yahoo!?
Get better spam protection with Yahoo! Mail.
http://antispam.yahoo.com/tools
_______________________________________________
darwin-development mailing list | email@hidden
Help/Unsubscribe/Archives: http://www.lists.apple.com/mailman/listinfo/darwin-development
Do not post admin requests to the list. They will be ignored.
_______________________________________________
darwin-development mailing list | email@hidden
Help/Unsubscribe/Archives: http://www.lists.apple.com/mailman/listinfo/darwin-development
Do not post admin requests to the list. They will be ignored.


References: 
 >Background app running as root and logout process (From: Robert Fab <email@hidden>)



Visit the Apple Store online or at retail locations.
1-800-MY-APPLE

Contact Apple | Terms of Use | Privacy Policy

Copyright © 2007 Apple Inc. All rights reserved.