Take the 2-minute tour ×
Ask Different is a question and answer site for power users of Apple hardware and software. It's 100% free, no registration required.

On Linux, I can get to a ssh or Ctrl-Alt-F1 console and type in a command to restart the window manager.

Is there any equivalent for Mac Mountain Lion?

I tried ssh'ing to a frozen Mac, and I could kill individual processes, but I could not unstuck the machine. Running the command sudo reboot killed my ssh ability, but did not restart the machine.

share|improve this question
    
This is probably doable, but it really depends on what's causing the beachballing. Does it happen with any predictability? If you can figure out which process is causing the issue, then killing it should work, unless it's something pretty low-level, or a hardware issue (I had a hard drive that would periodically drop connection, causing an unrecoverable beach ball). –  robmathers May 8 '13 at 20:45
    
If sudo shutdown -r now fails to kill off the processes and cause a reboot, you will probably need to pull the power or hold the power button pressed to recover. –  bmike May 8 '13 at 20:58
    
Yep, I had to hold the power button down. "shutdown" only seemed to cut off ssh. The beach ball never stopped. –  justingordon May 8 '13 at 22:11
    
→ Justin: Are you running MacOS X 10.8.3? –  daniel Azuelos May 10 '13 at 13:58
    
Yes, 10.8.3, latest MBP Retina. –  justingordon May 10 '13 at 17:58
show 2 more comments

2 Answers

To reply to your question: no there isn't such a function accessible at the window manager level. It is a good suggestion to forward to Apple MacOS X feedback

Is your Mac still up?

Try:

ping IP_of_my_mac

Can you access it with ssh?

Can you provide us a copy of the output of a:

top -o cpu

and:

tail -20 /var/log/system.log

If the problem appears once more, could you try to kill the loginwindow like this: connect on your mad Mac with ssh

/usr/bin/sudo /bin/kill `ps ax | grep '[/]loginwindow' | awk '{print $1}'`

This uggly command:

ps ax | grep '[/]loginwindow' | awk '{print $1}'

is a trick to give you the process ID of the loginwindow process with no risk to kill the wrong guy. I'm not sure this will be enough to force a total free and reset of the GPU. Please tell me if this doesn't work so I could remove a useless and dangerous workaround.

share|improve this answer
    
Top didn't show anything. Here are some log messages: 5/8/13 10:01:16.000 AM kernel[0]: IOVendorGLContext::ReportGPURestart 5/8/13 10:01:16.000 AM kernel[0]: NVDA(OpenGL): Channel exception! exception type = 0xd = GR: SW Notify Error, 5/8/13 10:19:31.913 AM mdworker[62359]: Unable to talk to lsboxd –  justingordon May 8 '13 at 22:16
    
It looks like you have a GPU hardware of driver problem. I advise you to make copies of these error messages and bring them to an AppleStore. –  daniel Azuelos May 9 '13 at 16:49
    
Now, no spinning beachball, but 2 more crashes: May 10 00:07:58 JustinMbp.local coreservicesd[29]: SendFlattenedData, got error #268435460 (ipc/send) timed out from ::mach_msg(), sending notification kLSNotifyApplicationDeath to notificationID=237 May 10 00:08:08 JustinMbp kernel[0]: NVDA(OpenGL): Channel timeout! May 10 00:08:15 JustinMbp.local sshd[4051]: Accepted keyboard-interactive/pam for justin from 192.168.1.69 port 42150 ssh2 May 10 00:08:15 JustinMbp.local sshd[4051]: USER_PROCESS: 4054 ttys017 May 10 00:08:28 JustinMbp kernel[0]: NVDA(OpenGL): Channel timeout! –  justingordon May 10 '13 at 10:12
    
May 10 00:08:36 JustinMbp.local fseventsd[43]: SLOWDOWN: client 0x7fb57401a800 (pid 2254) sleeping due to too many errors (num usleeps 11) –  justingordon May 10 '13 at 10:13
    
Running the last command to kill the login proces results in the plain cursor turning into a spinning beach ball. –  justingordon May 10 '13 at 10:15
show 2 more comments

I use this in a shell script called restart-graphical.sh

#!/bin/sh

sudo killall -HUP WindowServer

exit 0

This will NOT give you a chance to save anything.

Note that I have run into a situation where nothing will help except the power plug. This is often when a USB or FireWire device has caused an incurable hang.

share|improve this answer
    
I'm not sure what advantage this would be over the power switch? Avoid any disk errors maybe? –  justingordon May 10 '13 at 5:22
    
I tried this and the spinning beach ball disappeared, but nothing else happened. –  justingordon May 10 '13 at 10:17
    
The advantage is that you can try it in situations when you don't have access to the power switch. And if you can get to the login screen (which is what should happen when you run it) you may be able to do a clean reboot. –  TJ Luoma May 10 '13 at 16:15
    
No login screen appeared. I had to use the power switch. –  justingordon May 10 '13 at 17:57
add comment

Your Answer

 
discard

By posting your answer, you agree to the privacy policy and terms of service.

Not the answer you're looking for? Browse other questions tagged or ask your own question.