Re: Detecting login/logout?
Re: Detecting login/logout?
- Subject: Re: Detecting login/logout?
- From: Stéphane Sudre <email@hidden>
- Date: Sat, 1 Nov 2003 13:30:20 +0100
On samedi, novembre 1, 2003, at 12:59 PM, Wade Tregaskis wrote:
However, there are some issues with your application being terminated
with the login session that you might need to look at.
Yep. After a logout your application by default will get terminated
(actually killed) by the system. I won't go into why, lets just say
it has to do with a security model/feature inherited from NeXT.
Just to clarify, this will kill any apps in the user's context,
right... so apps that were started at boot time (prior to the
loginwindow process) - and magically survived the login - won't be
killed, right?
yes and no. As soon as your application links to the Window Server, it
will become mortal. If it does not, then it will survive.
Any idea off hand how the program is terminated? i.e. is it just a
signal that can be caught?
Your application will be sent a SIGKILL from WindowServer. SIGKILL
is a signal which can't be caught.
Yes, I'm rather aware of that. :)
Just out of curiosity, not for any specific reason, does the window
server first send a catchable signal? If not, how are programs
expected to shut down gracefully?
AFAIK, yes. Because an application can cancel logout or restart.
[...]
It is possible to communicate with mach ports if you jump through
some hoops. With some magic a process in the startup context
(mentioned above) can communicate with processes in the user context
and visa versa. However, processes in different user contexts can
not communicate directly with each other. If they need to
communicate they need to do so through the middle man in the startup
session.
Ah, this is better news in my case. Is there any
documentation/examples handy on what these hoops and magic are?
One solution is to use MessagePort from the process to the middleman
and then either use the new Daemon MessagePort API or a
CFDistributedNotification with Options to resdistribute the information.
_______________________________________________
cocoa-dev mailing list | email@hidden
Help/Unsubscribe/Archives:
http://www.lists.apple.com/mailman/listinfo/cocoa-dev
Do not post admin requests to the list. They will be ignored.