4

I have an off-site server, which I can get to physically if I drive to the office, but ash been having some stability issues lately.

So I dont have to wait until Monday to reboot the server, is there a way to have the server reboot automatically if it crashes?

Is this even a good idea?

1
  • What type of crashes are we talking about? Kernel Panics? Mar 11, 2011 at 0:04

2 Answers 2

3

The Xserve was the last mac hardware to ship with a controller chip to monitor the system with dedicated hardware.

Mac OS X Server has always had a watchdog like software process (first called watchdog - now launchd), so your best bet is to turn that on.enter image description here

If you find the built-in hang detection lacking, a good next step is to buy an internet controllable power outlet and simply set up whatever monitor/response time measure and trigger a reboot or an alert for a human to see if they can log in to address whatever issue has been raised.

2

Mac OS X and Mac hardware does not have any kind of watchdog capability to reboot after a crash. All Macs can be set to reboot after a power failure via the Energy Saver System Preferences panel, but not for crashes.

Intel-based Xserves support the Lights Out Management (LOM) implementation following the de-facto standard Intelligent Platform Management Interface (IPMI), which allows you to allocate separate IP addresses to the microcontrollers on the built-in Ethernet interfaces, and do things like remotely reboot (and shut down, and cold boot) the Xserve remotely.

It's a bit of a pain to set up because of two main gotchas:

  1. You have to use a separate IP address for the LOM feature. Don't make the mistake of trying to use your host Mac OS X's IP address because it'll conflict and the Ethernet interface will eat all the IP datagrams that were supposed to go to Mac OS X.

  2. For some inexplicable reason, the Ethernet microcontroller's LOM/IPMI feature can't use ARP to find the default gateway's MAC address, so you have to statically configure the interface to know the MAC address of its default gateway, and just hope that your default gateway router doesn't failover to a different MAC address or get replaced by a new box with a different MAC address when you weren't paying attention.

The Server Monitor app (/Applications/Server/Server Monitor.app) gives you a GUI to set some of this up, but configuring the static MAC address has to be done from the ipmitool(1).

...

Hmm, you might be able to use the pmset(1) command to schedule a periodic shutdown event followed by a poweron event, and then use a cron or launchd job to cancel it and reschedule it for sometime in the future if the machine hasn't crashed. I know the scheduled poweron events are handled by the System Management Controller, but I don't know how the shutdown events are handled. If they're somehow handled by the SMC as well, then I suppose there's a chance they'll work even on a crashed/frozen/hung/panicked/halted system. Never tried it myself. I only give it a 10% chance of working.

You must log in to answer this question.

Not the answer you're looking for? Browse other questions tagged .