Re: UNIX signals
Re: UNIX signals
- Subject: Re: UNIX signals
- From: Greg Parker <email@hidden>
- Date: Wed, 17 Dec 2008 11:22:13 -0800
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 email@hidden Runtime Wrangler
_______________________________________________
Cocoa-dev mailing list (email@hidden)
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:
This email sent to email@hidden