The method describer below can be handy when the graphical user environment of the computer becomes unresponsible (hangs). Because OS X has built to the UNIX core, the situation where you cannot do anything with your mouse or keyboard but the UNIX core is still running is not rare. I always try this method before doing anything harsh, like pressing and holding the power button.
There is an intelligent way to handle those hangs. Of course one can press and hold the power button, that is the hard way.
When graphic environment crashes and computer keeps hanging, there is a fat chance to be able to reboot from ssh session. For that you have to keep remote login on (preferences>sharing).
I opened ssh application on my iPhone (iPhone has a connection to the LAN via Wifi). You can also use another computer (using terminal.app for example) that is on the same LAN, I just didn't want to go upstairs for that
I logged into my computer with ssh, using an account that has admin privileges (important).
I entered "sudo su" command after login to my computer. That takes you to the superuser mode.
Then I executed command "reboot". The computer rebooted. Everything works fine, including UltraLite.
The routine described anove works only if the graphic environment has crashed and the unix core is still running fine. If one gets kernel panic (I like to call it "kennel panic") then computer is entirely frozen and can be restarted only the hard way.
I have been able to restart my computer intelligently several times after the graphic environment has become unresponsive.