On Dec 17, 2008, at 8:20 AM, Keary Suska wrote:
On Dec 16, 2008, at 8:27 PM, Jonathan Prescott wrote:
For everything else other than Cocoa and Carbon applications that receive AppleEvents, when the computer is shutdown, everything else is sent a SIGKILL by launchd, just like any other Unix system (launchd takes the place of the init daemon seen on other Unix systems). Semantics for BSD signals are described in the man pages (kill, signal, etc.). SIGINT is like hitting Ctrl-C at the terminal to stop a shell process. Processes can ignore a Ctrl-C. SIGKILL is non-ignorable.

For the record, this is incorrect. Each process is sent a SIGQUIT. It would be extremely bad for launchd to send a SIGKILL as a matter of course. You might as well just shut your computer down by turning off the power, if that was the case.

For the record, this is incorrect. launchd starts by sending SIGTERM. If the process is still alive after a timeout (20 seconds by default), launchd sends SIGKILL. If the process is still alive after that (5 seconds by default), launchd turns off the power anyway. (You can play along with launchd/src/launchd_core_logic.c)

But applications shouldn't care about any of this. Use NSApplication's termination machinery:
http://developer.apple.com/documentation/Cocoa/Conceptual/AppArchitecture/Tasks/GracefulAppTermination.html


--
Greg Parker     gpar...@apple.com     Runtime Wrangler


_______________________________________________

Cocoa-dev mailing list (Cocoa-dev@lists.apple.com)

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 arch...@mail-archive.com

Reply via email to