Originally, I need to distinguish logging out from shutting down or
restarting. Since there isn't an easy way to do that, I am thinking to find
a way to tell only when the user is logging out and let the machine do
whatever it wants when shutting down or restarting.Do you have a better idea
how to do it?
This is going to be hard to distinguish depending on what you mean by "daemon". If you are a true daemon (that runs outside the login context), then you can use SystemConfiguration. You will get a callback when somebody logs in and logs out.

However if you are a Cocoa application (which I assume you are since you posted to cocoa-dev) then this will be difficult to determine. Your application will be quit by loginwindow regardless of whether the user is restarting or logging out, because either way all Cocoa/Carbon applications will be quit. The login/logout notifications will only be posted after your application has already quit.

Please describe what you mean by "daemon" and how your application is being launched.

Ryan
[EMAIL PROTECTED]
_______________________________________________

Cocoa-dev mailing list ([email protected])

Please do not post admin requests or moderator comments to the list.
Contact the moderators at cocoa-dev-admins(at)lists.apple.com

Help/Unsubscribe/Update your Subscription:
http://lists.apple.com/mailman/options/cocoa-dev/archive%40mail-archive.com

This email sent to [EMAIL PROTECTED]

Reply via email to