Super User is a question and answer site for computer enthusiasts and power users. It's 100% free, no registration required.

Sign up
Here's how it works:
  1. Anybody can ask a question
  2. Anybody can answer
  3. The best answers are voted up and rise to the top

What happens behind the scenes when a user gives a Quit or Force Quit command from outside the target application (e.g. from Activity Monitor)?

share|improve this question
up vote 5 down vote accepted

As a general rule, the “Quit” operation is not a signal; it is an Apple Event, which is the same type of inter-process communication used for AppleScript scripting and for opening files or URLs in already-running applications, and comes from the Mac OS lineage rather than Unix.

A process has to specifically register to receive Apple Events, and such processes are either GUI processes or at least associated with a desktop session (which, outside of Activity Monitor, is the only way they can end up being told to quit at all).

However, if you “Quit” a process from Activity Monitor and that process has not registered to receive Apple Events, it will send SIGTERM (15) instead.

share|improve this answer

You can use dtrace to see what signals are sent to processes:

sudo dtrace -n 'proc:::signal-send /pid/ { printf("%s -%d %d", execname, args[2], args[1]->pr_pid); }'

If you force quit an application that is shown in the Dock, the signal is usually -15 (TERM). But if you force quit a background process from Activity Monitor, it is usually -9 (KILL).

share|improve this answer
Interesting. How is the distinction made between apps and background processes? – Blacklight Shining Sep 29 '12 at 0:54
I didn't test it with that many processes, but I meant processes that don't have a menu bar or are not shown in the Dock or the force quit window. – user495470 Sep 29 '12 at 3:05

You can view Force Quit events for GUI applications sent to system.log. Or, use dtrace as posted in this thread. With dtrace you get more granularity but need root privileges.

share|improve this answer
-1 (inaccurate): /var/log/system.log doesn't record signals. – Blacklight Shining Apr 27 '13 at 17:10
@BlacklightShining Try launching and Force Quitting it via Activity You should see a line like this Apr 28 13:04:21[136] ([0x0-0x3e13e1][5336]): Exited: Terminated: 15 It doesn't register the Quit event though. – 1.61803 Apr 28 '13 at 11:15
Granted, this works for GUI apps. However, if you start some other process and signal it, it will not be logged. Thus you can't, in general, “view the signals sent” in system.log. – Blacklight Shining Apr 28 '13 at 11:29
@BlacklightShining I emended my post to reflect your comment. – 1.61803 Apr 28 '13 at 11:36

Your Answer


By posting your answer, you agree to the privacy policy and terms of service.

Not the answer you're looking for? Browse other questions tagged or ask your own question.