Originally Posted By: dkmarsh
Is Relaunch really just a GUI front end to killall Finder, though? At an earlier point in time, you thought so, but experimentation suggested otherwise.

Weird! I did write that, but I don't remember the experiment.

I had done a simple test just before posting my earlier reply above, in case behavior had changed since the last time I checked remember checking.

So, I did some more extensive tests. The primary test is: change something in the interface (move a window, change a view, navigate a window to a different folder, etc.), quit and restart Finder by whatever method, and see if that latest change got preserved. The four methods I tested were:

1. Use an AppleScript to 'tell application "Finder" to quit'
2. Use option-right-click on Finder's Dock icon, and select "Relaunch Finder"
3. Select Finder from Activity Monitor, click "Quit Process", and then click "Quit"
4. Select Finder from Activity Monitor, click "Quit Process", and then click "Force Quit"

In methods 1 and 3, Finder quits and stays quit. You can restart it by clicking on its Dock icon. All changes are saved and restored. Nothing noteworthy shows in Console.

In methods 2 and 4, Finder quits but immediately relaunches. Recent changes are almost always lost. Once in a blue moon, a recent change will be preserved. That's probably what I saw in the quoted experiment. There is a message in Console, from "com.apple.launchd.peruser.501[pid1]" notifying that "(com.apple.Finder[pid2]) Exited: Terminated", where pid1 is the instance of launchd handling LaunchAgents on my behalf, and pid2 is the particular instance of Finder that was running.

To verify that Finder is being run as a LaunchAgent, I found:
/System/Library/LaunchAgents/com.apple.Finder.plist
Code:
<?xml version="1.0" encoding="UTF-8"?>
<!DOCTYPE plist PUBLIC "-//Apple//DTD PLIST 1.0//EN" "http://www.apple.com/DTDs/PropertyList-1.0.dtd">
<plist version="1.0">
<dict>
	<key>RunAtLoad</key>
	<false/>
	<key>KeepAlive</key>
	<dict>
		<key>SuccessfulExit</key>
		<false/>
		<key>AfterInitialDemand</key>
		<true/>
	</dict>
	<key>Label</key>
	<string>com.apple.Finder</string>
	<key>Program</key>
	<string>/System/Library/CoreServices/Finder.app/Contents/MacOS/Finder</string>
	<key>ThrottleInterval</key>
	<integer>0</integer>
</dict>
</plist>

Notice that, as observed, once Finder is launched it is kept active until it exits successfully. That gives us a quicker test: if Finder stays quit, you know it received a quit message; if it comes right back, you know it was killed.

Since Finder is running as a LaunchAgent, we can ask launchd to give us more information, using the command:

launchctl list com.apple.Finder | grep LastExitStatus

After "Quit Finder", the last exit status is 0, as expected.
After "Relaunch Finder", the last exit status is 15, which is SIGTERM.

Note that SIGTERM is the signal that killall uses by default, so yes, "Relaunch Finder" does the same as "Killall Finder" (except that it probably uses launchctl to get Finder's pid and uses that with kill, so as to limit collateral damage in case there's another process also called Finder).