[Nut-upsuser] APC Smart UPS at a Mac Mini

Charles Lepple clepple at gmail.com
Thu Sep 1 02:32:09 UTC 2011


On Aug 31, 2011, at 7:53 AM, Wolfgang Hottgenroth wrote:

> [ups.delay.shutdown]
> Interval to wait after shutdown with delay command (seconds)
> Type: ENUM
> Option: "060" SELECTED
> Option: "180"
> Option: "300"
> Option: "600"
>
> [ups.delay.start]
> Interval to wait before (re)starting the load (seconds)
> Type: ENUM
> Option: "000" SELECTED
> Option: "060"
> Option: "180"
> Option: "300"

Given these two commands, you could probably cover most cases by  
writing a script for the shutdown command which runs "upsdrvctl  
shutdown", then shuts the Mac down in the 60 (or 180, 300 or 600)  
seconds before the UPS cuts power to the Mac. It's not ideal, but I  
suspect most recent Macs will shut down in 60 seconds or less.

The one potential race condition is if the power comes back on after  
the delayed shutdown command, but before the UPS cuts power. The  
problem occurs if the UPS doesn't cycle power anyway. The Mac would  
power down, but wouldn't see a loss of AC, and would stay powered down.

Still haven't had a chance to see how OS X handles this, but they do  
seem to have commands equivalent to NUT's ups.delay.shutdown:

http://developer.apple.com/library/mac/#documentation/Darwin/Reference/ 
IOKit/IOPSKeys_h/index.html#//apple_ref/c/macro/ 
kIOPSCommandDelayedRemovePowerKey



More information about the Nut-upsuser mailing list