• Open Menu Close Menu
  • Apple
  • Shopping Bag
  • Apple
  • Mac
  • iPad
  • iPhone
  • Watch
  • TV
  • Music
  • Support
  • Search apple.com
  • Shopping Bag

Lists

Open Menu Close Menu
  • Terms and Conditions
  • Lists hosted on this site
  • Email the Postmaster
  • Tips for posting to public mailing lists
Re: UNIX signals
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

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


References: 
 >Re: UNIX signals (From: Chris Idou <email@hidden>)
 >Re: UNIX signals (From: Andrew Farmer <email@hidden>)
 >Re: UNIX signals (From: Jonathan Prescott <email@hidden>)
 >Re: UNIX signals (From: Keary Suska <email@hidden>)

  • Prev by Date: Re: The Ages Old __MyCompanyName__ Question
  • Next by Date: Re: The Ages Old __MyCompanyName__ Question
  • Previous by thread: Re: UNIX signals
  • Next by thread: NSPredicateEditor and aggregate operations
  • Index(es):
    • Date
    • Thread