Fix Slow Shutdown in OS X 10.8-10.9

Discussion in 'OS X Mountain Lion (10.8)' started by 53kyle, Jun 1, 2013.

  1. 53kyle, Jun 1, 2013
    Last edited: Mar 14, 2014

    macrumors 65816

    53kyle

    Joined:
    Mar 27, 2012
    Location:
    Sebastopol, CA
    #1
    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
     
  2. macrumors 65832

    SR45

    Joined:
    Aug 17, 2011
    Location:
    Florida
    #2
    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
     
  3. thread starter macrumors 65816

    53kyle

    Joined:
    Mar 27, 2012
    Location:
    Sebastopol, CA
    #3
    I just automated that for some experience in xcode programming and to make it easy for people who are uncomfortable with terminal.
     
  4. macrumors 68030

    Krazy Bill

    Joined:
    Dec 21, 2011
    #4
    Does your app give the user the option to "undo" and revert your changes?
     
  5. macrumors regular

    Joined:
    May 19, 2013
    #5
    Just open the script and change numbers back to the defaults.
     
  6. macrumors 65832

    SR45

    Joined:
    Aug 17, 2011
    Location:
    Florida
  7. macrumors 68020

    Joined:
    Jun 15, 2012
    #7
    Please explain what effect repair permissions (or not repairing permissions) will have?
     
  8. macrumors 65832

    SR45

    Joined:
    Aug 17, 2011
    Location:
    Florida
    #8
    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. ;)
     
  9. thread starter macrumors 65816

    53kyle

    Joined:
    Mar 27, 2012
    Location:
    Sebastopol, CA
    #9
    I am about to upload a version that will automatically repair disk permissions after finishing (maybe)
     
  10. macrumors 68020

    Joined:
    Jun 15, 2012
    #10
    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
     
  11. thread starter macrumors 65816

    53kyle

    Joined:
    Mar 27, 2012
    Location:
    Sebastopol, CA
    #11
    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
     
  12. benwiggy, Jun 3, 2013
    Last edited: Jun 3, 2013

    macrumors 68020

    Joined:
    Jun 15, 2012
    #12
    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.
     
  13. thread starter macrumors 65816

    53kyle

    Joined:
    Mar 27, 2012
    Location:
    Sebastopol, CA
    #13
    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 :)
     
  14. macrumors 603

    justperry

    #14
    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.
     
  15. thread starter macrumors 65816

    53kyle

    Joined:
    Mar 27, 2012
    Location:
    Sebastopol, CA
    #15
    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.
     
  16. macrumors 603

    justperry

    #16
    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:

     
  17. HenryAZ, Jun 5, 2013
    Last edited: Jun 5, 2013

    macrumors 6502

    HenryAZ

    Joined:
    Jan 9, 2010
    Location:
    South Congress AZ
    #17
    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.
     
  18. thread starter macrumors 65816

    53kyle

    Joined:
    Mar 27, 2012
    Location:
    Sebastopol, CA
    #18
    OS X Mavericks doesn't fix the slow shutdown but I am pretty sure my app or the terminal commands still work.
     
  19. macrumors 68030

    fhall1

    Joined:
    Dec 18, 2007
    Location:
    NY State of mind
    #19
    How do you know what the defaults were/are?
     
  20. macrumors 68020

    Joined:
    Jun 15, 2012
    #20
    There was no such key before it was written: you need to do a defaults delete on that parameter, and the system will use the default of 20 seconds.
     
  21. macrumors newbie

    Joined:
    Jul 4, 2013
    #21
    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 !
     
  22. thread starter macrumors 65816

    53kyle

    Joined:
    Mar 27, 2012
    Location:
    Sebastopol, CA
    #22
    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
     
  23. macrumors newbie

    Joined:
    Jul 4, 2013
  24. macrumors 6502

    Joined:
    Aug 10, 2012
    Location:
    Over here
    #24
    Thank you 53Kyle. Works. Thank you for your efforts. Now wish Apple would take some time to do same :D
     
  25. macrumors member

    Joined:
    Sep 21, 2012
    #25
    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.
     

Share This Page