Submit Hint Search The Forums LinksStatsPollsHeadlinesRSS
14,000 hints and counting!


Click here to return to the 'Possibly recover from a freeze without a reboot' hint
The following comments are owned by whoever posted them. This site is not responsible for what they say.
Possibly recover from a freeze without a reboot
Authored by: DarylF2 on Feb 08, '06 08:43:38AM

This sort of this has happened to me a few times, thankfully its very infrequent. I log in to the locked up machine via another of my Macs using ssh (enabled on all my Macs via System Preferences -> Sharing -> Services, the check "Remote Login").

From the command line on the remote Mac, I ssh into the "frozen" Mac and force it to shutdown via the "sudo shutdown -r now" command. This nearly always worked; I've only had to use the power button to restart my G5 once or twice.



[ Reply to This | # ]
Possibly recover from a freeze without a reboot
Authored by: daniel.beck on Feb 08, '06 10:04:16AM

Why would shutdown -r from a remote machine be preferable to rebooting with the power key?



[ Reply to This | # ]
Possibly recover from a freeze without a reboot
Authored by: glycon on Feb 08, '06 10:53:50AM

Because it would be a "safe" restart instead of a "hard" restart (holding power button).



[ Reply to This | # ]
Possibly recover from a freeze without a reboot
Authored by: inertia186 on Feb 08, '06 10:59:23AM

Good question. From the man pages for shutdown(8):

The shutdown utility provides an automated shutdown procedure for super-users to nicely notify users when the system is shutting down, saving them from system administrators, hackers, and gurus, who would otherwise not bother with such niceties.

It doesn't mention anything about cleanly shutting down. But if you look at the man pages for reboot(8), it's a little more clear:

The halt and reboot utilities flush the file system cache to disk, send all running processes a SIGTERM (and subsequently a SIGKILL) and, respectively, halt or restart the system. The action is logged, including entering a shutdown record into the wtmp(5) file.

Normally, the shutdown(8) utility is used when the system needs to be halted or restarted, giving users advance warning of their impending doom and cleanly terminating specific programs.

Whether or not this informs the WindowServer process, isn't directly alluded to. But I'm sure it gets the message.



[ Reply to This | # ]
Possibly recover from a freeze without a reboot
Authored by: gaoshan on Feb 08, '06 12:45:54PM
I have used ssh to get into a frozen mac but often you do not have to do a reboot. If you run the unix command "top" you can see which applications are running. If one is causing the freeze-up it will often show a huge cpu usage. Killing that process will often free up the computer. Here are the commands:
  1. Remote Login must already be enabled on the Mac. Just leave it on all the time, it is useful and secure.
  2. From another machine (Mac, Linux, Windows... they can all do this):
    ssh root@192.168.1.100
    root is whatever username you use and the ip address is whatever your machine is actually on.
  3. top -o cpu
    this will list everything running on the machine in order of cpu usage. Note the PID (Process ID) number on the far left.
  4. kill -9 2294
    where 2294 is the actual PID of the thing you want to stop. kill stops a process and -9 simply means "no excuses... kill it no matter what".
If that doesn't free up your machine you could try killing the Finder (get it's PID using top... it should restart on it's own) and if THAT doesn't do it then do the reboot.

[ Reply to This | # ]
Possibly recover from a freeze without a reboot
Authored by: jdv on Feb 09, '06 11:48:01AM
Most people won't need to get the pid's, but can just use killall. For example to kill the Finder, do
killall -9 Finder
This could cause trouble on a multi user machine, so be careful if other people are logged in. On the other hand if your desktop is frozen, odds are all other processes are frozen too...

[ Reply to This | # ]