Fix Slow Shutdown in OS X 10.8-10.9

53kyle

macrumors 65816
Original poster
Mar 27, 2012
1,278
95
Sebastopol, CA
I threw together an app that should fix 20-30 second shutdown times. Feedback is appreciated, here it is:

https://www.dropbox.com/s/54k6yodqgdfp1i6/OS X Shutdown Fix.dmg

Tip: also disable internet sharing, that slows down shutdown time a lot.

IMPORTANT: go to system preferences > security & privacy > turn on downloads from anywhere

ALSO IMPORTANT: If you want to re-apply this on your computer or change the speed, you must first click on the "Default" button, then click on your desired speed.

ALSO IMPORTANT TOO: This is really only compatible with OS X 10.8-10.8.5 Mountain Lion. I will still try again to find out how to fix mavericks, but as of now there is nothing for it.

UPDATE 6/11: Download the new version using the above link. It takes longer but it will at least work now and may speed up your entire system!

UPDATE 7/4: Download version 1.2 using the link above. There is a new button for if you decide that you want to wait to shut down your mac :p

UPDATE 10/5: Download version 1.3 using the link above. New features:
- New option for slightly slower speed in case you have a stray application running, thanks to "Risco"
- MUCH faster, thanks to "mag01" for suggesting different terminal commands, and no more hanging!
- Compatible with OS X 10.8.5
 
Last edited:

SR45

macrumors 65832
Aug 17, 2011
1,501
0
Florida
I use the method below for a faster 3 to 4 second shutdown. Before anyone downloads your app, why don't you tell us a little bit about it first. (Should) in your post is some what iffy and needs clarification. What have you experienced ?

Type these commands into the terminal window one by one, and right after terminal repair permissions in the disc utility.

sudo defaults write /System/Library/LaunchDaemons/com.apple.coreservices.appleevents ExitTimeOut -int 1

sudo defaults write /System/Library/LaunchDaemons/com.apple.securityd ExitTimeOut -int 1

sudo defaults write /System/Library/LaunchDaemons/com.apple.mDNSResponder ExitTimeOut -int 1

sudo defaults write /System/Library/LaunchDaemons/com.apple.diskarbitrationd ExitTimeOut -int 1

sudo defaults write /System/Library/LaunchAgents/com.apple.coreservices.appleid.authentication ExitTimeOut -int 1
 

53kyle

macrumors 65816
Original poster
Mar 27, 2012
1,278
95
Sebastopol, CA
I use the method below for a faster 3 to 4 second shutdown. Before anyone downloads your app, why don't you tell us a little bit about it first. (Should) in your post is some what iffy and needs clarification. What have you experienced ?

Type these commands into the terminal window one by one, and right after terminal repair permissions in the disc utility.

sudo defaults write /System/Library/LaunchDaemons/com.apple.coreservices.appleevents ExitTimeOut -int 1

sudo defaults write /System/Library/LaunchDaemons/com.apple.securityd ExitTimeOut -int 1

sudo defaults write /System/Library/LaunchDaemons/com.apple.mDNSResponder ExitTimeOut -int 1

sudo defaults write /System/Library/LaunchDaemons/com.apple.diskarbitrationd ExitTimeOut -int 1

sudo defaults write /System/Library/LaunchAgents/com.apple.coreservices.appleid.authentication ExitTimeOut -int 1
I just automated that for some experience in xcode programming and to make it easy for people who are uncomfortable with terminal.
 

SR45

macrumors 65832
Aug 17, 2011
1,501
0
Florida
Please explain what effect repair permissions (or not repairing permissions) will have?
First time I tried the shutdown fix that was posted above by another member, I did not use the repair permission, and the shutdown fix did not work. Unknown why....Doing it again with the repair permission, and it did work. At least for me I needed the repair permission first. Others will weigh in on their personal experience. ;)
 

53kyle

macrumors 65816
Original poster
Mar 27, 2012
1,278
95
Sebastopol, CA
I am about to upload a version that will automatically repair disk permissions after finishing (maybe)
 

benwiggy

macrumors 68020
Jun 15, 2012
2,184
15
First time I tried the shutdown fix that was posted above by another member, I did not use the repair permission, and the shutdown fix did not work. Unknown why....Doing it again with the repair permission, and it did work.
I am about to upload a version that will automatically repair disk permissions after finishing (maybe)
Repair Permissions is not some universal panacea for all problems. It restores SOME Apple System files to the values help in lists in the /Library/Receipts folder. Almost EVERY file is unlikely to have its permissions changed since installed, unless deliberate action has been taken by the user.
The RP process reports confusing error messages EVERY TIME it is run.

All those Terminal commands do is to alter the parameters of already running processes. How can "repairing" the permissions of processes that are already running affect their ability to take up the new settings?

Most reports of "I ran RP, then it worked" are likely to be coincidental.
http://en.wikipedia.org/wiki/Post_hoc_ergo_propter_hoc
 

53kyle

macrumors 65816
Original poster
Mar 27, 2012
1,278
95
Sebastopol, CA
Repair Permissions is not some universal panacea for all problems. It restores SOME Apple System files to the values help in lists in the /Library/Receipts folder. Almost EVERY file is unlikely to have its permissions changed since installed, unless deliberate action has been taken by the user.
The RP process reports confusing error messages EVERY TIME it is run.

All those Terminal commands do is to alter the parameters of already running processes. How can "repairing" the permissions of processes that are already running affect their ability to take up the new settings?

Most reports of "I ran RP, then it worked" are likely to be coincidental.
http://en.wikipedia.org/wiki/Post_hoc_ergo_propter_hoc
All I know is that when I first ran the terminal commands it was fast for one time and then after reading about repairing permissions I tried it and it worked
 

benwiggy

macrumors 68020
Jun 15, 2012
2,184
15
All I know is that when I first ran the terminal commands it was fast for one time and then after reading about repairing permissions I tried it and it worked
All I know is that I had an argument with my neighbour and then my cow died. The two things must be connected, right? Because one happened after the other one. She must be a witch! :D

But seriously, so it worked "one time"? And then it stopped working? And then RP "fixed" it? I guarantee you that RP had nothing to do with it.

Sorry to hammer this point home, but I see "Have you tried repairing permissions?" everywhere and it is severely over-rated. It was originally included because Classic OS9 mode didn't respect Unix permissions, so things could get out of hand. But that was back in the day.
 
Last edited:

53kyle

macrumors 65816
Original poster
Mar 27, 2012
1,278
95
Sebastopol, CA
The new version is ready and uploaded and will work better than the first one! If the old version didn't work, try this one :)
 

justperry

macrumors G4
Aug 10, 2007
10,522
5,955
I'm a rolling stone.
Have to agree with Benwiggy here, the commands SR45 gave includes sudo and no file permissions changing command like chown/chmod, this means the permissions on that file will not change.
No need to Repair Permissions.
 

53kyle

macrumors 65816
Original poster
Mar 27, 2012
1,278
95
Sebastopol, CA
Have to agree with Benwiggy here, the commands SR45 gave includes sudo and no file permissions changing command like chown/chmod, this means the permissions on that file will not change.
No need to Repair Permissions.
Once again, I wouldn't even bother repairing permissions if it wasn't worth it. Repairing permissions, even if it isn't related to the commands, could clear up some other problems that stall shutdown.
 

justperry

macrumors G4
Aug 10, 2007
10,522
5,955
I'm a rolling stone.
Once again, I wouldn't even bother repairing permissions if it wasn't worth it. Repairing permissions, even if it isn't related to the commands, could clear up some other problems that stall shutdown.
Have to disagree, when you use the sudo together with the commands above it won't change anything.
I never ever had any problem with permissions except for the ones I changed myself, permissions don't rust as Benwiggy says nicely.

Maybe you should read the following link.

Five Mac maintenance myths

But I will quote a part of it:

Myth #1: “You should repair permissions regularly.”
OS X’s permissions determine the access each user has to each item on a hard drive. If certain files have the wrong permissions, you can experience problems. So you’ll commonly hear that you need to use Disk Utility’s Repair Disk Permissions feature on your startup drive as a routine maintenance procedure.

But contrary to popular belief, repairing permissions—a procedure which simply resets permissions to a known state—works only on a particular subset of OS X system files. It doesn’t affect user files, nor does it affect third-party files or programs. In other words, it’s unlikely that regularly repairing permissions will prevent problems.

If you ever do have a problem with system-level permissions, your Mac will likely behave oddly, and you’ll usually be able to use the Repair Disk Permissions function then to fix the problem without any data loss or long-term effects. So I recommend repairing permissions as a troubleshooting tool rather than a maintenance task. For a comprehensive look at this topic, see Repairing Permissions: What you need to know.
 

HenryAZ

macrumors 6502a
Jan 9, 2010
626
109
South Congress AZ
Repair Permissions is not some universal panacea for all problems. It restores SOME Apple System files to the values help in lists in the /Library/Receipts folder. Almost EVERY file is unlikely to have its permissions changed since installed, unless deliberate action has been taken by the user.
The RP process reports confusing error messages EVERY TIME it is run.

All those Terminal commands do is to alter the parameters of already running processes. How can "repairing" the permissions of processes that are already running affect their ability to take up the new settings?

Most reports of "I ran RP, then it worked" are likely to be coincidental.
http://en.wikipedia.org/wiki/Post_hoc_ergo_propter_hoc
In general I agree with this. The few times I run RP (from a recovery partition), I see at most one or two files changed. So, I don't usually run RP, unless I suspect something might be wrong with permissions.

I just applied the 5 terminal commands mentioned above by SR45. What I should have done (in light of this discussion) but failed to do, was note permissions before doing this.

I wouldn't even have thought to check afterwards, except I started receiving a new error on startup
Code:
launchctl: no plist was returned for: /System/Library/LaunchAgents/com.apple.coreservices.appleid.authentication.plist
and of course this was one of the files that was altered, so I did go check. Doing a directory listing (ls -al) of /System/Library/LaunchAgents showed that the file in question had a permission mode of 600, while every other file in the directory was 644.

Since the other four files involved were in /System/Library/LaunchDaemons, I checked there as well. Those four files were 600, while every other file was 644.

As I said, I failed to note the permissions beforehand, but so far this strongly points to something having changed permission-wise with those five files. So, I did run RP (again from a recovery partition). Sure enough, in addition to one odd other file, the only files that whose permissions were repaired were those five, and they went from 600 to 644.

And the error in Console went away.

Go figure. I would not think those commands would change permissions in addition to altering the shutdown timer, but they apparently did.
 
Last edited:

53kyle

macrumors 65816
Original poster
Mar 27, 2012
1,278
95
Sebastopol, CA
OS X Mavericks doesn't fix the slow shutdown but I am pretty sure my app or the terminal commands still work.
 

Mirumoto

macrumors newbie
Jul 4, 2013
2
0
Hi guys,

First of all thanks for the script, it does reduce the shutdown time.

However I would like to try once again to identify the problem, can you please tell me which command to type to remove the exit timeout values?

sudo defaults write /System/Library/LaunchDaemons/com.apple.coreservices.appleevents ExitTimeOut -int 1

I would like to remove the parameters the script put in place.

Thanks !
 

53kyle

macrumors 65816
Original poster
Mar 27, 2012
1,278
95
Sebastopol, CA
Hi guys,

First of all thanks for the script, it does reduce the shutdown time.

However I would like to try once again to identify the problem, can you please tell me which command to type to remove the exit timeout values?

sudo defaults write /System/Library/LaunchDaemons/com.apple.coreservices.appleevents ExitTimeOut -int 1

I would like to remove the parameters the script put in place.

Thanks !
I have updated the app to have a revert option, but here is the command:

sudo defaults delete /System/Library/LaunchDaemons/com.apple.coreservices.appleevents ExitTimeOut
 

ultraspiracle

macrumors member
Sep 21, 2012
93
4
i think you will be happy with 10.8.5

Shutdown issue seems to be fixed - I'm not kidding. Please note that with the small exception of one year, Apple's fix for this issue came ahead of schedule.
 

Similar threads

Register on MacRumors! This sidebar will go away, and you'll see fewer ads.