I've been involved with the thread from the beginning and have read every item here. Let me summarize some things. It will likely help about 60% to 70% of the time. For a 100% fix, it's got to come from Apple.
There seem to be two kinds of processes that are most involved (most--not all of the time):
2) several notificationcenter processes whose plist files are found in System/Library/LaunchDaemons and System/Library/LaunchAgents
In Lion, the default timeout during shutdown was 2 seconds for most of these processes while in Mountain Lion it's 20 seconds. There are some specific instructions below (that I copied from one of the threads dealing with this issue) for editing these system plist files using terminal. I prefer to do it within the full version of TextWranger (with command line tools) obtained from the Bare Bones Software Web site. The version that you can get from the Mac App Store doesn't allow you to edit system files. However, the potential for seriously messing up your installation of your operating system exists if you edit system files. Unless you've done this type of thing before and have confidence in your ability to not mess things up, don't do it. Always have a full backup before doing this.
In my case, setting the default timeout to 2 seconds for my appleidauthentication gave me back fast shutdowns about 2/3rds of the time on a 2011 MacBook Air. My wife, running the same software on her 2010 MacBook Air (that used to have fast shutdowns with Lion), gets slow shutdowns about 80% of the time and she hasn't altered the default timeout for this system process. Also, in my case, changing the default timeout for anything having to do with the notification center didn't help much. I know it helps other users which illustrates why this problem can only really be fixed by Apple.
The instructions below give some help identifying which processes are causing your slow shutdowns. However, as I said above, this isn't foolproof because sometimes you will still have a slow shutdown and there will no processes that timed out during your previous shutdown. And, in all cases, if you modify a system plist file, repair disk permissions using Disk Utility BEFORE you shut down.
Here are the instructions:
Use Console to find out if certain system processes are timing out during during your shutdown. Do this after every slow shutdown.
1) Perform a shutdown
2) Start again, open Console
3) Open system.log from the left pane
4) Enter "exit timeout" in the search field on the top right
5) You would get a list of daemons/agents which are timing out, they have a 20 second timer
Use the following commands to manually specify their timeout to 2 seconds:
In terminal, type the following: (example here is com.apple.coreservices.appleid.authentication.plist)
sudo launchctl unload /System/Library/LaunchAgents/com.apple.coreservices.appleid.authentication.plis t
sudo defaults write /System/Library/LaunchAgents/com.apple.coreservices.appleid.authentication ExitTimeOut -int 2
sudo launchctl load /System/Library/LaunchAgents/com.apple.coreservices.appleid.authentication.plis t
Some plists are present in the LaunchDaemons folder instead of LaunchAgents. Modify the above commands accordingly.
These commands will kill the errant agents/daemons in 2 seconds instead of the new default of 20 seconds since Lion.
[For some reason, the command line instructions above have a space in the ".plist" between the s and the t. I've tried to edit it out, but for some reason the software used in these forums keeps putting back that space. It obviously should not be there.]
hey everyone, it's been a while since i've check back here. after doing al the mods suggested here to ExitTimeOuts i got a system that shuts down quick about 60-70% of the time and stalls the rest. sometimes for up to 60 SECONDS! lol.. it's totally absurd.
one thing i will mention is recently i changed to a verbose boot, which incidentally results in a verbose shutdown sequence. this way i can see everything as it happens (like the system killing processes that i've tagged for the 2 second for instance). oddly, since changing to verbose my shutown times vary but never seems to take more than 5 seconds or so. dunno if this is just luck of the draw or if something has actually changed. i'd be curious for some of you more experienced users to try this and report back with you experiences.
have a great weekend!
in my case Console shows this:
Mar 17 05:28:20 iMac-di-STEFANO com.apple.launchd (com.apple.coreservices.appleid.authentication): Exit timeout elapsed (20 seconds). Killing
Mar 17 06:16:33 iMac-di-STEFANO com.apple.launchd (com.apple.coreservices.appleid.authentication): Exit timeout elapsed (20 seconds). Killing
Mar 17 06:23:06 iMac-di-STEFANO com.apple.launchd (com.apple.coremedia.videodecoder): Exit timeout elapsed (20 seconds). Killing
Mar 17 07:12:24 iMac-di-STEFANO com.apple.launchd (com.apple.coreservices.appleid.authentication): Exit timeout elapsed (20 seconds). Killing
Mar 17 09:35:51 iMac-di-STEFANO com.apple.launchd (com.apple.coreservices.appleid.authentication): Exit timeout elapsed (20 seconds). Killing
Can you help me, please?
Wiktor Mankowski wrote:
in my case the problem seems to be locataed in com.apple.coremedia.videodecoder. However, I can't find this file neither in lunchagents nor in lunchdeamons. Could you give me some help on this frustrating subject?:)
wiktor, processes like that are normally handled by launchd. you can try in terminal:
$ launchctl list
$ sudo launchctl list
in order to view daemons/configuation files are currently loaded at a user level and at a root level respectively. i don't seem to even have the daemon you mentioned present onmy laptop so it must be something specific to your setup.
have a look at the man pae for launchctl:
this is the command line program used to interact with launchd. it may be useful.
maybe try "locate com.apple.coremedia.videodecoder" if your locate database exists. or you could use the free app "easyfind". chances are if it's a system process the configuration fie resides at either "/System/Library/LaunchDaemons/" or "/System/Library/LaunchAgents/". thoug i seriously doubt you will discover much about the reason for os x stalling. this bug is widespread enough and it seems once you squash it one place it pops up in another.
I highly recommend Billy Noah's suggestion from March 16 to set up your Mac to startup and shutdown in verbose mode. That way, during a slow shutdown, you can see what's causing the slow shutdown.
To use verbose mode, enter the following in Terminal (you'll need an admin password)...
sudo nvram boot-args="-v"
To disable verbose mode, enter the following Terminal command...
sudo nvram boot-args=
You can also do it on a one-time basis by pressing command-V at startup.