Become a MacRumors Supporter for $50/year with no ads, ability to filter front page stories, and private forums.

Tricia McMillan

macrumors newbie
Feb 16, 2014
2
0
Hi! My mac also have a very slow shutdown, about 1minute 40seconds with no apps running at all (even the dashboard is killed). I don't understand because it's a brand new (about 2 weeks old) iMac 27 with a "clean" preinstalled Mavericks and a 3TB fusion drive. I ran a permission verification and disk verification with disk utility and everything is supposedly fine. I installed/uninstalled some stuff but I was careful to uninstall properly. I don't use any keychain. I do run a local network with OS X Server but it's almost only to sync my calendar. Any idea of what it might be or where to look?
 

ABC5S

Suspended
Sep 10, 2013
3,395
1,646
Florida
Hi! My mac also have a very slow shutdown, about 1minute 40seconds with no apps running at all (even the dashboard is killed). I don't understand because it's a brand new (about 2 weeks old) iMac 27 with a "clean" preinstalled Mavericks and a 3TB fusion drive. I ran a permission verification and disk verification with disk utility and everything is supposedly fine. I installed/uninstalled some stuff but I was careful to uninstall properly. I don't use any keychain. I do run a local network with OS X Server but it's almost only to sync my calendar. Any idea of what it might be or where to look?

This has been going on since Lion, so nothing new, but there is a work around using Terminal that it will shutdown in about 2/3 seconds. For me, I'll just let it slide.

https://forums.macrumors.com/threads/1589712/
 

Tricia McMillan

macrumors newbie
Feb 16, 2014
2
0
This has been going on since Lion, so nothing new, but there is a work around using Terminal that it will shutdown in about 2/3 seconds. For me, I'll just let it slide.

https://forums.macrumors.com/threads/1589712/

Thanks for your reply ABC5S. I am not sure that I feel comfortable about changing settings in Terminal just to make sure I don't make things worse than they already are. So I think I'll follow your advise to "let it slide". It doesn't really bother me, it's just that I want to make sure this is not the symptom of a bigger problem and find out while I'm still under warranty. I also want to make sure I received the mac I paid for :/ But from what I "noobily" read from my console reports it seems that it might only be my OS X Server that slows everything down, so be it.
 

Merode

macrumors 6502a
Nov 5, 2013
623
617
Warsaw, Poland
Same here, after I've bought my late 2013 rMBP, the shutdowns were really quick (maybe about 3 seconds). After updating OS X to 10.9.1 it shuts down longer - maybe about 10 seconds? Sometimes it even displays spinning wheel on grey screen.

I always shut down with all apps closed. Might be it has nothing to do with 10.9.1 but something just got messy - not sure. From time to time I still get quick shutdowns. I'd prefer to have them more often. :)
 

LV426

macrumors 68000
Jan 22, 2013
1,831
2,256
I have a brand new 15" rMBP and the shutdown time is insanely slow. It's even slower at shutting down then my old 2010 MBP which doesn't even have a SSD. The startup time is really, really good, I'd just like to speed up my shutdowns.

Is what the OP posted safe to do? I'm curious, what does it actually do? I've seen it posted around, but I've never tried it. Anyone have any other good tips?

Your apps and OS need a certain minimum time to safely tidy up when you request a shutdown. If you force the system's hand so that important processes give up doing a controlled shutdown after only 1 second, I don't see how that could be called safe.

If I were going to force a shutdown (the software equivalent of pulling a wire out of a battery), I'd give it more time than 1 second before the hammer falls.
 

helice

macrumors newbie
Feb 27, 2014
1
0
very frustraded

Hi to everyone, I have MBP mid 2010, just a couple a months ago, I bought a evo 840 samsung SSD, I was using OS 10.6.8 SL, I use my machine to work on music production, it was running better than a new mac, the music applications open in less then 5 seconds, the boot 15 seconds, and shutdown 2 seconds, yesterday I made the mistake of installing mavericks 10.9.2, what a nightmare, the boot is ok, but the shutdown takes like 30 seconds, I been to so many forums and just found a script to use in terminal, but it does not work, I am very frustraded about this, what the hell is happening to apple, I regret switching to mavericks, SL worked great, I tried to use the time machine but it did not got snow leopard back, hope they fix this issue. Or if anyone already did work this out I will be very greatful if you can help.
 

tucsonmac

macrumors newbie
Mar 5, 2014
3
1
Slow log out as well

I have a 2011 imac 27 inch and i not only have slow shut down, but a slow log out as well. I have done a clean install twice, and moved things over both for the old computer, Time Machine and just adding things of a hard drive. Everything works fast and well for about a week and then things change. The initial log in takes over a minuet, log out over a minuet, and shut down over 2 minuets. I work on the exact same machine at work with the same operating system 10.9.1 and it has none of these problems. I was ordering if the internal hard drive sleeps some how?
 
Last edited:

conspiracy21

macrumors newbie
Feb 12, 2014
3
0
This made my macbook shutdown in 1.5 seconds

Try this, it fixed it for me.

Turn off wifi

Open keychain

Locate your WiFi keychain entry and delete it from keychain. Delete all occurrences you can find for it in keychain.

Restart your mac

Reconnect to your wifi network you will need to enter your wifi pass code. Let it connect and then try and restart. And see if it has improved the slow shutdown. It fixed mine and now takes around 1-2 second to switch off.

This made my rMBP late 2013 shutdown in 1.5 seconds :)

thanks so much...
i was trying to figure out this issue since a month but all was in vain until i found this method...
thanks so much again...! :)
 

solmaker

macrumors member
Nov 23, 2007
89
14
SOLVED by removing WhiteHat Aviator!

WhiteHat Aviator was repeatedly showing up as com.whitehatsec.aviator.dmg in Disk Utility. There's no uninstaller, but I removed Aviator by deleting:

Library/LaunchAgents/com.aviator.agent.plist
Library/Aviator (containing com.aviatorupdate.agent, RunUpdate, UpdateAviator, etc.)
Library/Caches/Aviator
Library/Caches/AviatorEngine
Library/Caches/UpdateEngine-Temp/com.whitehatsec.aviator.dmg-etc.
Library/Caches/UpdateEngine.503/Downloads/com.whitehatsec.aviator.dmg
Library/LaunchAgents/com.aviator.agent.plist
Library/Application Support/Aviator
Library/Preferences/com.whitehatsec.aviator.plist
Library/Saved Application State/com.whitehatsec.aviator.savedState

As a huge side benefit, my system no longer hangs for a minute on shutdown!

For further details, see solmaker posts at: https://discussions.apple.com/thread/6337331
 

benlukes

macrumors regular
Jul 13, 2014
134
161
Wifi "fix" didn't work

I have an early 2011 MBP and just upgraded to 10.9.4 from 10.6.8 a few days ago. Hugely disappointing.

I tried mds1256's wifi fix, and it didn't work for me. Do I have to delete all wifi passwords, or just ones for wifi networks I could connect to from my current location? After deleting the passwords for my home wifi network my shutdown time was still roughly 25 seconds. It used to be around 5 seconds or less with 10.6.8 (I have an SSD).

Mavericks is great! Slow shutdowns and regular freezing (almost never happened in 10.6.8). I can't leave my computer on for even a few hours without it crashing.
 

mateus

macrumors regular
Sep 30, 2007
101
2
Try this, it fixed it for me.
Turn off wifi
Open keychain
Locate your WiFi keychain entry and delete it from keychain. Delete all occurrences you can find for it in keychain.
Restart your mac
Reconnect to your wifi network

Thank you! This fixed the slow shutdown problems on my MBP. Shutdown had increased to about 20s, now it's just 3 seconds! :D
 

navier

macrumors regular
Aug 4, 2011
220
230
Germany
Thank you! This fixed the slow shutdown problems on my MBP. Shutdown had increased to about 20s, now it's just 3 seconds! :D

I also tried this and didn't help :( shutdown time remains 20s

Has someone another suggestion?
 

h9826790

macrumors P6
Apr 3, 2014
16,611
8,537
Hong Kong
Open Console, navigate to launchd-shutdown.system.log in /var/log/com.apple.launchd

Search the phrase "after the first signal was sent"

Check the numbers following "Exited" in each line. One (or more) may be around 20 seconds. These are the processes that cause the delay if the last shutdown was slow.

e.g. the slow shutdown process is com.displaylink.displaylinkmanager

You need to find out the path of this file. You can do this via Finder (search with "System files" "Are included"), and then insert an ExitTimeOut via terminal.

e.g.

sudo defaults write /Library/LaunchDaemons/com.displaylink.displaylinkmanager ExitTimeOut -int 1

This should fix the slow shutdown issue. Or at least you can identify what cause the slow shutdown.
 

navier

macrumors regular
Aug 4, 2011
220
230
Germany
Open Console, navigate to launchd-shutdown.system.log in /var/log/com.apple.launchd

Search the phrase "after the first signal was sent"

Check the numbers following "Exited" in each line. One (or more) may be around 20 seconds. These are the processes that cause the delay if the last shutdown was slow.

e.g. the slow shutdown process is com.displaylink.displaylinkmanager

You need to find out the path of this file. You can do this via Finder (search with "System files" "Are included"), and then insert an ExitTimeOut via terminal.

e.g.

sudo defaults write /Library/LaunchDaemons/com.displaylink.displaylinkmanager ExitTimeOut -int 1

This should fix the slow shutdown issue. Or at least you can identify what cause the slow shutdown.

Great! :)

It hasn't helped to reduce drastically the shutdown time, but helped for further troubleshooting

Thank you!
 

iBoo

macrumors newbie
Oct 20, 2014
1
0
Slow shutdown

I just wanted to post that this thread helped me :)
I was running Mavericks without any problems. I have replaced the mechanical hard drive with a nice and quiet SSD drive and I start up in 10 seconds and shutdown in 1-3 seconds. Then I made the mistake of downloading Yosemite yesterday - Apples newest OS X - and I hated the look of it so much that I quickly found my USB drive with the Mavericks system on it and did a clean install. Afterwards my shutdown was suddenly up to like 10 or 20 seconds :mad: What helped was doing another clean install and then not setting up my wifi and iCloud in the beginning (just opted to go past all of it) but in stead I set up my email account and everything else later. It seems my slow shutdown had to do with that cos now it shuts down really fast again, so this might help anyone with a slow shutdown time while running Mavericks.
 

SOO1

macrumors newbie
Oct 25, 2014
1
1
Solution for slow shutdown of OSX

looking into various other posts which recommend to use any of the below:

  • Reset permissions with Disk Utility
  • Add ExitTimeOut = 1 with sudo defaults write /System/Library/LaunchDaemons/com.apple.mDNSResponder ExitTimeOut -int 1
  • Clean Re-Instal
  • ...
  • and many other suggestions

I found that nothing worked - my shutdown time was constant at 20 seconds. Within log file /var/log/com.apple.launchd/launchd-shutdown.system.log I always found at the end that the user process com.apple.launchd.peruser.501 was hanging and needed to be killed after the default of 20 seconds. I tested then to log out first, wait 30 seconds and then trigger the shutdown from the logon screen and then it was very fast. I therefore created the following script which solved the problem - it basically does the same as the normal shutdown - send TERM, wait and then KILL the remaining user processes (just faster).

1. Open Terminal and execute following command to create LogoutHook

sudo defaults write com.apple.loginwindow LogoutHook ~/.logouthook

2. Create text file logouthook.txt with the following content (replace <your user-id> with your real user name)

#!/bin/bash
echo $'\n*** Shutdown ***\n' >>/users/<your user-id>/.shutdown.log
date >>/users/<your user-id>/.shutdown.log
echo $'\n all processes \n' >>/users/<your user-id>/.shutdown.log
ps -u <your user-id> >>/users/<your user-id>/.shutdown.log
killall -u <your user-id> -TERM&
sleep 1
echo $'\n 1 second after sending 1st TERM signal \n' >>/users/<your user-id>/.shutdown.log
ps -u <your user-id> >>/users/<your user-id>/.shutdown.log
killall -u <your user-id> -TERM&
sleep 1
echo $'\n 1 second after sending 2nd TERM signal \n' >>/users/<your user-id>/.shutdown.log
ps -u <your user-id> >>/users/<your user-id>/.shutdown.log
killall -u <your user-id> -KILL&


3. In the terminal to rename the file and make it executable

mv logouthook.txt .logouthook
chmod +x ~/.logouthook


The script works perfectly - shutdown time now constantly at 3 seconds - and the processes which ignored the TERM signals are listed in the logfile ~/.shutdown.log - one might use that info for further analysis.

the above works for OSX 10.8, 10.9, 10.10
 
  • Like
Reactions: snorkybingo

dcnicholls

macrumors newbie
Dec 13, 2007
20
1
Canberra, Australia
Thanks for that. I'll test it out. It's worth noting that the emailed version of the script has been entirely garbled, so anyone wanting to try the script needs to visit the Macrumors forums page to see it properly
 

h9826790

macrumors P6
Apr 3, 2014
16,611
8,537
Hong Kong
I therefore created the following script which solved the problem - it basically does the same as the normal shutdown - send TERM, wait and then KILL the remaining user processes (just faster).

It works in 10.10, super fast shut down now.
 

Creditcard

macrumors member
Oct 6, 2008
51
0
looking into various other posts which recommend to use any of the below:

  • Reset permissions with Disk Utility
  • Add ExitTimeOut = 1 with sudo defaults write /System/Library/LaunchDaemons/com.apple.mDNSResponder ExitTimeOut -int 1
  • Clean Re-Instal
  • ...
  • and many other suggestions

I found that nothing worked - my shutdown time was constant at 20 seconds. Within log file /var/log/com.apple.launchd/launchd-shutdown.system.log I always found at the end that the user process com.apple.launchd.peruser.501 was hanging and needed to be killed after the default of 20 seconds. I tested then to log out first, wait 30 seconds and then trigger the shutdown from the logon screen and then it was very fast. I therefore created the following script which solved the problem - it basically does the same as the normal shutdown - send TERM, wait and then KILL the remaining user processes (just faster).

1. Open Terminal and execute following command to create LogoutHook

sudo defaults write com.apple.loginwindow LogoutHook ~/.logouthook

2. Create text file logouthook.txt with the following content (replace <your user-id> with your real user name)

#!/bin/bash
echo $'\n*** Shutdown ***\n' >>/users/<your user-id>/.shutdown.log
date >>/users/<your user-id>/.shutdown.log
echo $'\n all processes \n' >>/users/<your user-id>/.shutdown.log
ps -u <your user-id> >>/users/<your user-id>/.shutdown.log
killall -u <your user-id> -TERM&
sleep 1
echo $'\n 1 second after sending 1st TERM signal \n' >>/users/<your user-id>/.shutdown.log
ps -u <your user-id> >>/users/<your user-id>/.shutdown.log
killall -u <your user-id> -TERM&
sleep 1
echo $'\n 1 second after sending 2nd TERM signal \n' >>/users/<your user-id>/.shutdown.log
ps -u <your user-id> >>/users/<your user-id>/.shutdown.log
killall -u <your user-id> -KILL&


3. In the terminal to rename the file and make it executable

mv logouthook.txt .logouthook
chmod +x ~/.logouthook


The script works perfectly - shutdown time now constantly at 3 seconds - and the processes which ignored the TERM signals are listed in the logfile ~/.shutdown.log - one might use that info for further analysis.

the above works for OSX 10.8, 10.9, 10.10

Thanks a lot this works really really well! Shutdown time went from 20 to 2 seconds!!
 

writerjdo

macrumors newbie
Nov 7, 2014
4
0
Help this newb

Hi S001- I really want to implement your instructions, but I am lost. Yes I am an OSX neophyte although I've been working with MSDOS Batch files since 1985 (boo-hiss). Anyhow I've tried the three steps.

I open the terminal and copy/paste your "sudo" line and press Enter-I supply it with my password.

I then create the .txt file (I save it as an RTF) and replace <your user-id> with john

I then try the mv command, but it keeps telling me the file cannot be found. I am sorry I am such a newb at this but the Yosemite shutdown is bugging the hell out of me-please excuse my newness and help if possible-Thanks!
 

sharon22

macrumors regular
Oct 19, 2014
194
0
Just have Console running, and watch what it does as soon as you hit Shut Down.

Then, after you start it back up, look at all the stuff Console logged during the Shut down.

You can figure out exactly EXACTLY what is slow, because for every console log notation, there is a Timestamp.

No biggy, this is easy to figure out. Just watch, be a detective, and then you'll know why it's slow.
 

writerjdo

macrumors newbie
Nov 7, 2014
4
0
Thanks Sharon,
I still have had no luck with this. I guess I'm doomed to slow boots until there's a patch. Weird because in Mavericks my boots were sub 5 seconds.
 

writerjdo

macrumors newbie
Nov 7, 2014
4
0
Well I went through the day long pain of a complete redux of a clean yosemite install. And I'm back to slow shut downs... twas all for naught. Wish I could make the logouthook trick work... Any help would be appreciated.
 
Register on MacRumors! This sidebar will go away, and you'll see fewer ads.