Lessons from power glitch and outage
Steve Rhodes
steve at qi-journal.com
Tue Oct 25 00:35:18 EDT 2016
Old school thinking cost me many hours of troubleshooting just a week ago. I experience power outages often in this area and have a UPS backup that keeps a couple Mac Minis running 24/7. But I was away when the UPS ran out of gas causing a hard shutdown on both minis.
One started fine when the power came back. One started but anything that involved the finder would lock it up... and that was just about everything. Had to replace the system folder from a recent time machine backup to get it up and running again.
But I can confirm that both machines restarted on regaining power from a hard shutdown. But I will also say this wasn't the first time they went down hard and that they have run flawlessly for many years, so I can't really complain. Just keep good backups.
On Oct 24, 2016, at 05:12 PM, Tom Yarmas <tom at yarmas.com> wrote:
> Corruption risk from an unclean shutdown? I think that’s just old school thinking. OS X has had journaling of HFS volumes on by default since like 2002, I think. Windows was probably the last time you really risked file system corruption from an unclean shutdown. Have anyone lost data recently due to an unclean shutdown? I know I think nothing of power cycling my many Macs during a hang or other problem.
>
> Just don’t see how the Mac is supposed to know to power back on once the power comes back if you shutdown the system properly???
>
> -tom
>
>
>> On Oct 24, 2016, at 6:36 PM, Mike Andrews <mikea0 at gmail.com> wrote:
>>
>> That's Microsoft-worthy stupidity - either risk corruption from an unclean shutdown or have it not come cak when power is restored.
>> Is there a way to power up a Mac externally, like with Wake-on-LAN?
>>
>> --Mike
>>
>>
>> On Mon, Oct 24, 2016 at 1:08 PM, Kurt Sheffer <ksheffer at mindspring.com> wrote:
>> The Mac definitely won’t turn itself back on after a clean shutdown. Nothing has changed in that regard. I’m hesitant to pull the plug to test it the other way.
>>
>> I had to unplug my UPS from USB recently because of a strange problem. When the UPS kicks in due to a voltage dip (a frequent event here), the entire Mac OS GUI will freeze up and become unresponsive. XTension also stops processing events— it’s like time has stopped. I can still SSH in and do a "shutdown -r now” but I can't get logged in even with a physical keyboard and monitor. It doesn’t happen every time of course. That would be too easy. Now I’ve disconnected the USB interface and we’ll see if it’s a software problem, or something related to the quality of the power provided by the UPS.
>>
>> -Kurt
>>
>>> On Oct 19, 2016, at 8:59 AM, James Sentman <james at sentman.com> wrote:
>>>
>>> Our power was off for several days with Hurricane Matthew. (the house was absolutely fine though many neighbors were not so lucky, all our trees feel away from the house! It will be some time before the yard and all those trees are cleared up) I THOUGHT I had everything setup. I expected XTension to be running when I arrived back home after our evacuation but it was not! I had the restart after a power failure turned on, yet the mini did not restart.
>>>
>>> You don’t need to install any software for the UPS, OSX supports all those things automatically. Just plug it in and it will show up as if the mac had a battery like a macbook. You can then set the regular settings in the energy saver control panel like usual.
>>>
>>> unfortunately what you don’t want to do is to have it shut down cleanly. If you do a clean shutdown then the “restart after a power failure” doesn’t work. Or at least it didn’t work I will have to revisit these things since they aren’t working the way I thought they did anymore.
>>>
>>> What you can do is as soon as the power goes out you can tell XTension to write it’s database to disk, and then you can do a sync on the file systems so that the disks are less likely to be corrupt if power is lost. The journaling should keep them OK anyway, but I still do this. If you setup the UPS interface in XTension you can create a unit for the AC power and when it turns off you can do a:
>>>
>>>
>>> save database
>>> do shell script “sync”
>>>
>>> the sync makes sure that all the caches have been written to disk. Then if the power does fail you won’t lose anything. You might do something clever with the time left unit on the UPS and do this closer to the time that it will actually shut you off, but make sure you’re not doing it constantly after a certain time or something. I would actually create a scheduled event to run a global script in say a minute. In the global script I would check to see if the power is still off and the time left unit is less than say 10 minutes and if so I would do the save and the sync and then exit. If the power was on I would just exit. If the power was still off and the time left was more than 10 minutes I would do an execute script (thisScript) in 1 * minutes so that it will keep checking until either the power comes back on or until the time left runs down to the point of doing the task.
>>>
>>> We may all want to revisit our power failure logic as mine just isn’t doing what I thought it was doing anymore. I will post again about it when I’ve figured out why my mini didn’t restart with the power.
>>>
>>>> On Oct 18, 2016, at 7:54 PM, Mike Andrews <mikea0 at gmail.com> wrote:
>>>>
>>>> Set the option on the Mac server to power up when power is restored.
>>>> Put in UPS monitoring to get a clean shutdown for good measure
>>>>
>>>
>>> Thanks,
>>> James
>>>
>>>
>>> James Sentman http://www.PlanetaryGear.org http://MacHomeAutomation.com
>>>
>>>
>>>
>>>
>>> _______________________________________________
>>> XTensionList mailing list
>>> XTensionList at machomeautomation.com
>>> http://mail.machomeautomation.com/mailman/listinfo/xtensionlist
>>
>>
>> _______________________________________________
>> XTensionList mailing list
>> XTensionList at machomeautomation.com
>> http://mail.machomeautomation.com/mailman/listinfo/xtensionlist
>>
>>
>> _______________________________________________
>> XTensionList mailing list
>> XTensionList at machomeautomation.com
>> http://mail.machomeautomation.com/mailman/listinfo/xtensionlist
>
> _______________________________________________
> XTensionList mailing list
> XTensionList at machomeautomation.com
> http://mail.machomeautomation.com/mailman/listinfo/xtensionlist
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://mail.machomeautomation.com/pipermail/xtensionlist/attachments/20161024/b637f27b/attachment.html>
More information about the XTensionList
mailing list