OS X and UPS?
September 26, 2008 2:59 PM Subscribe
OS X and a APC UPS - clever solutions?
I have this UPS and I would like to configure my 10.5 machine to handle interruptions intelligently. The UPS has a USB out, so I assuming it sends signals that I can work with. I'd like the computer to eject the two Firewire drives whenever it loses power, etc. I'd like more options (I'm thinking scripts as opposed to a GUI), if possible.
Anyone have any clever OS X UPS solutions?
I have this UPS and I would like to configure my 10.5 machine to handle interruptions intelligently. The UPS has a USB out, so I assuming it sends signals that I can work with. I'd like the computer to eject the two Firewire drives whenever it loses power, etc. I'd like more options (I'm thinking scripts as opposed to a GUI), if possible.
Anyone have any clever OS X UPS solutions?
Mac OS X has built-in software that will recognize the UPS, which will then show up in the Energy Saver control panel. (The UPS also probably came with software, but you don't need it.) It doesn't do anything that fancy, it just lets you automatically shut down when a certain amount or percentage of runtime is left. You can also have it sleep the screen and disks faster when it's on the UPS, of course. If you need more functionality, it looks like you are going to be doing the coding yourself. I found a couple of shareware things on MacUpdate that might have helped if their Web sites had been responding.
posted by kindall at 3:24 PM on September 26, 2008
posted by kindall at 3:24 PM on September 26, 2008
Oh, I must have missed the script option in PowerChute. Excellent catch.
posted by kindall at 3:27 PM on September 26, 2008
posted by kindall at 3:27 PM on September 26, 2008
When I talked to APC support a couple of weeks ago, PowerChute isn't yet supported on OS X 10.5 Intel machines. Equinux has a product "APC Tracker" that may be of some use to you, if you don't get anywhere with APC's own software.
posted by crysflame at 3:33 PM on September 26, 2008
posted by crysflame at 3:33 PM on September 26, 2008
Seconding APC PowerChute PE. You can add whatever other shutdown stuff you need, in addition to timing info:
As well as support for serial connections, PowerChute has the ability to trigger scripts prior
to shutdown. PowerChute Personal Edition looks for an executable file with the following
pathname:
This file is optional, and is not present by default. The file and directory can only be created
by a user with root access.
posted by Blazecock Pileon at 3:34 PM on September 26, 2008
As well as support for serial connections, PowerChute has the ability to trigger scripts prior
to shutdown. PowerChute Personal Edition looks for an executable file with the following
pathname:
/etc/comapcpcpe/PowerChute.pre_shutdown
This file is optional, and is not present by default. The file and directory can only be created
by a user with root access.
posted by Blazecock Pileon at 3:34 PM on September 26, 2008
You can do this with just scripting and the Energy Saver system preference panel, no 3rd party software necessary, by writing a Mac OS X StartupItem that calls drutil.
posted by RichardP at 5:12 PM on September 26, 2008
- Use the Energy Saver system preference panel to configure the Mac to shutdown automatically when UPS failure is imminent.
- Create a directory called "EjectDrive".
- Create a text file named "EjectDrive" in the "EjectDrive" folder.
- This text file should have the following contents (note that this example ejects the default drive, you might have to adjust the parameters to drutil to specify the particular drive you wish to eject):
#!/bin/sh ### Eject drive on shutdown##. /etc/rc.commonStartService (){ # do nothing return 0}StopService (){ ConsoleMessage "Ejecting drive" /usr/bin/drutil tray eject return 0}RestartService (){ StopService StartService return 0}RunService "$1"
- Create a text file named "StartupParameters.plist" in the "EjectDrive" folder.
- This text file should have the following contents:
{ Description = "Eject default drive at stutdown."; Provides = ("EjectDrive"); Requires = (); Uses = (); OrderPreference = "None";}
- Copy the "EjectDrive" folder to "/Library/StartupItems/".
- Set the permissions in the EjectDrive folder as mentioned in the Startup Item Permissions section of the StartupItem document. If you wish, you can omit this step. If you do, your Mac will complain on the next boot that a startup item has invalid permissions and offer you the options of having the OS set the permissions of these files for you.
- Restart your computer.
posted by RichardP at 5:12 PM on September 26, 2008
This thread is closed to new comments.
posted by SNACKeR at 3:17 PM on September 26, 2008