Regular shutdown vs. UPS shutdown behavior (& QuickTime Broadcaster)

I have my Mac Pro set to shut down after 1 minute of UPS battery power, and it indeed shuts down. However, when it shuts down by this method, it corrupts any video files that are currently being recorded in QuickTime Broadcaster, making them unusable once power is restored and I start the machine again. I am using the built-in OS X UPS power options.

If I simply select "Shut Down" (or "Restart") from the regular Apple menu while QTB recordings are in progress, the video files are preserved.

It was my understanding that the shutdown behavior in these two instances shouldn't be different, but it appears that it is. This machine is used for automated live video encoding, and the purpose of adding the UPS was to guarantee a graceful shutdown in the event of power loss. Any ideas? I just tried adding a "LogoutHook" to stop the broadcasts, but it doesn't appear to help -- the QuickTime Broadcaster process must get killed before any logout items are called?

It doesn't seem to matter what trigger I use in the UPS Energy Saver preference pane (shutdown after X minutes, with X minutes power left, or with X percent power left), and my other Energy Saver options are set as follows:
- Never sleep computer
- Sleep display after 1 minute
- Schedule startup for 7:00 AM and shutdown for 10:30 PM daily
- No wake for ethernet access
- No "Allow power button to sleep"
- No "Restart automatically"
- Yes "Show UPS status in menu bar"

Below are the entries I found in the system log for both methods of shutting down.

Regular Shutdown:
Sep 28 15:15:13 mydomain loginwindow[24]: DEAD_PROCESS: 0 console
Sep 28 15:15:13 mydomain shutdown[159]: halt by unitemcr:
Sep 28 15:15:13 mydomain shutdown[159]: SHUTDOWN_TIME: 1254168913 349077
Sep 28 15:15:13 mydomain com.apple.loginwindow[24]: Shutdown NOW!
Sep 28 15:15:13 mydomain mDNSResponder mDNSResponder-176.3 (Sep 30 2008 16:59:38)[23]: stopping
Sep 28 15:15:13 mydomain com.apple.loginwindow[24]: System shutdown time has arrived^G^G

UPS Battery Shutdown:
Sep 28 15:00:41 mydomain UPS[180]: Shutting down due to power loss!
Sep 28 15:00:41 mydomain shutdown[182]: halt by root: Shutting down due to power loss!
Sep 28 15:00:41 mydomain shutdown[182]: SHUTDOWN_TIME: 1254168041 255398
Sep 28 15:00:41 mydomain mDNSResponder mDNSResponder-176.3 (Sep 30 2008 16:59:38)[23]: stopping
Sep 28 15:00:41 mydomain /System/Library/CoreServices/Finder.app/Contents/MacOS/Finder[95]: dnssd_clientstub read_all(13) failed 0/28 0

Interestingly, sending a shut down command via Apple Remote Desktop produces the same effect as the UPS battery shutdown -- the video files in progress are corrupt. Here are the system log entries from that procedure:
Sep 28 15:23:08 mydomain shutdown[152]: halt by myusername:
Sep 28 15:23:08 mydomain shutdown[152]: SHUTDOWN_TIME: 1254169388 203071
Sep 28 15:23:08 mydomain com.apple.RemoteDesktop.agent[82]: Shutdown NOW!
Sep 28 15:23:08 mydomain com.apple.RemoteDesktop.agent[82]: System shutdown time has arrived^G^G
Sep 28 15:23:08 mydomain mDNSResponder mDNSResponder-176.3 (Sep 30 2008 16:59:38)[23]: stopping
Sep 28 15:23:08 mydomain /System/Library/CoreServices/AirPort Base Station Agent.app/Contents/MacOS/AirPort Base Station Agent[79]: dnssd_clientstub read_all(4) failed 0/28 0
Sep 28 15:23:08 mydomain /System/Library/CoreServices/Finder.app/Contents/MacOS/Finder[96]: dnssd_clientstub read_all(13) failed 0/28 0

2 x 2.8 GHz Quad-Core Intel Xeon, Mac OS X (10.5.8)

Posted on Sep 28, 2009 2:21 PM

Reply
6 replies

Sep 28, 2009 3:46 PM in response to spycake

As far as I am aware the UPS control does not have the facility of actually ordering a normal system shutdown as you expect. After X minutes the UPS simply removes power causing a power outage.

The UPS is intended to provide power once a real outage has occurred to give you the opportunity to perform a normal shutdown before the UPS battery expires.

I think you have greater expectations of the UPS' smarts than actually exists.

Sep 29, 2009 8:35 AM in response to spycake

Mabe it is Mac OS, which doesn't recover very well either and can leave journal and directory file system in bad shape.

APC PowerChute Personal 2.2 for Windows seems to work and do more orderly shutdowns. There is no version for OS X though. I think it should be expected to do safe flush of cached writes to disk.

Also, there really should be a hibernation image of what was in RAM as well.

Sep 29, 2009 10:38 AM in response to Kappy

Thanks for the reply. I know the machine isn't getting its power killed like a normal outage -- the system log snippets I posted shows that it is getting a shutdown command.

I thought the whole point of linking the UPS and the Mac Pro via USB cable, and having UPS power options integrated into OS X, was that the operating system could do a normal, graceful system shutdown based on information received from the UPS unit. It correctly receives the time or percentage of battery power remaining, and displays that on the menu bar -- it should be a simple matter for the OS to monitor this and perform a regular shutdown when certain thresholds of battery power are reached, correct?

If OS X doesn't do this, is there an easy way to script this? Have an Applescript monitoring program, that checks the UPS status and does a graceful restart when the UPS battery life remaining gets too low?

Sep 29, 2009 11:46 AM in response to spycake

I don't know if your UPS can be scripted. You'll have to consult the manual that came with it. I have an APC UPS on my Mac Pro and all it will do is perform a shutdown based on one of three options based on a time period on battery power. I assume that will be a normal shutdown but I've never tested it. It's controlled in Energy Saver preferences under Scheduling options in the UPS tab.

Sep 29, 2009 12:33 PM in response to spycake

As I said I have never tested the behavior myself. We rarely have outages unless a power line goes down or a transformer explodes or a rat gets fried in the local area's main power distribution facility. If that happens I just do my own manual shutdown rather tan leave everything running until the UPS shuts down.

You can report the behavior here: Feedback. If the engineers can replicate the behavior then they may incorporate a fix in a future version of OS X.

This thread has been closed by the system or the community team. You may vote for any posts you find helpful, or search the Community for additional answers.

Regular shutdown vs. UPS shutdown behavior (& QuickTime Broadcaster)

Welcome to Apple Support Community
A forum where Apple customers help each other with their products. Get started with your Apple Account.