Server Restart Option
User Manual
[ Previous Page
| Table of Contents
| Next Page ]
Using the Server Restart Option
The best way to ensure that your system stays up and running is to attack the problem from several fronts. This section describes several example Events that you can mix, match and modify to form a coordinated restart strategy.
Automatic Restarts
Crash Restart
One of the most powerful uses of the Server Restart Option is also the simplest. This Event uses a When System Crashes Trigger and a Restart Action to restart the computer when it crashes.
This Event will cover most situations where the system comes to a complete halt.
| If your server does not run 24 hours a day, you can add a Time Range Qualifier to this Event. |
Soft Crashes
Sometimes an application will crash, leaving other applications running. Since the PowerKey software is still running, the crash will not be detected. Apple's "Macsbug" debugger can freeze the system enough so that these crashes will be detected by PowerKey Pro.
To use this ability, simply install Macsbug. No special configuration is necessary. Macsbug can be obtained at Apple's web site.
Restarting after a Power Failure
To automatically start up your computer after a power failure, create an Event with a When Power Returns Trigger and a Start Up Computer Action.
| Do not use a Restart Action here, since that Action will not restore power to your other outlets. |
PowerKey Pro will sense when power returns and automatically start up your computer.
Restarting with a Phone Call
There may be times when the system isn't completely crashed, but you need to "manually" restart it remotely. If you have a phone line connected to PowerKey Pro, this Event lets you restart the computer with a phone call.
Be sure to set the number of rings high, to keep wrong numbers from inadvertently restarting your computer.
| If your system is running when this Event executes, it will attempt to do a normal Finder restart. If you check the Force Restarts check box in the Preferences dialog box, this will force a restart even if something goes wrong during the restart attempt. |
| PowerKey Pro also works with the "distinctive ringing" phone service, which can allow you to use the same phone line for remote access and remote restarts. See Chapter 4 of the PowerKey Pro manual, System Triggers, for more information. |
Other Issues
Dealing with File Sharing
If a user is connected to your computer with File Sharing when an Event is attempting to shut down or restart it, this dialog box will appear.
This dialog box will interrupt the shut down process, and utilities like Okey Dokey can't automatically dismiss it.
You can solve this problem by creating an AppleScript® to turn off File Sharing, and running it from your Events before shutting down or restarting.
| The "Stop File Sharing" AppleScript included with the system software will not work for this, since it displays its own dialog box when it runs. |
To use this AppleScript, save it in the Script Editor as a "compiled script." Edit any Events that shut down or restart the computer, and place an Execute Script Action before the Shut Down Computer or Restart Actions. It may also be a good idea to place a Wait Action in the middle, to make sure that the script is finished before attempting to shut down or restart.
Monitoring Custom Applications
Custom applications, such as databases or interactive presentations, can "ping" the PowerKey software in much the same way that the PowerKey software pings the hardware. You can use the When Timer Expires Trigger to restart the system when your application crashes or otherwise fails to respond.
You must design your application to periodically send an Apple Event to the PowerKey software, telling it to set the User Timer to, for example, 300 seconds. When your application stops resetting the User Timer, it will continue counting down. If the User Timer reaches zero, this Event will restart the system.
To set the User Timer from AppleScript, create the following script:
If you are not running AppleScript, you can send a simple Apple Event to the PowerKey software. This Apple Event should have an Event Class of 'PKPr' and an Event ID of 'Tick'.
[ Previous Page
| Table of Contents
| Next Page ]

