How to force Mac to into dirty shutdown state on every power off?
As Far as I can tell no one has actually solved this debacle. How do you get a mac mini to power on every time the UPS it is connected to restores power? It is easy enough to have the UPS communicate that power is about to turn off so have the mac run the command halt -u, or shutdown -h -u, etc, and many solutions such as powerchute from APC guarantee that it will shutdown etc. But it is not guaranteed that the mac will turn back on. If this bit/开发者_运维百科 file was permanently set so mac the mac believed that it dirty shutdown every time, whatever hardware is responsible for the power sensing of the power restored would always boot the mac when power is restored, even if the mini was powered off during while it booted. Currently if your mini powers off without dirty shutdown being set you are boned, and you must physically press the power button on the back for it to restart, which is unacceptable if the mini is says 5000 miles away or at the bottom of the ocean. You should be able to get this functionality even if no UPS is involved just by having the mac always try to reboot when power is restored. Has anyone ever figured this out?
Have you checked the setting in the Energy Saver preference panel?
System Preferences
-> Energy Saver
-> Options
-> Restart automatically after a power failure
Or see man pmset
:
$ pmset -a autorestart 1
Ned almost had the answer - it's on [the man page][1](Apple copy, currently broken) he mentioned.
pmset schedule [cancel] type date+time [owner]
-g sched displays scheduled startup/wake and shutdown/sleep events.
Have a shutdown script run pmset to schedule the system to wake up half an hour or so (let the power stabilize and the UPS time to recharge) from now.
Oh, and BTW: looking through the output of pmset -g everything
, I see:
INVOKE: pmset -g ups
UPS settings:
haltlevel off 0
haltafter off 0
haltremain off 0
[1]: Oddly, Apple has taken down its web-formatted man pages; best I can find: http://www.manpagez.com/man/1/pmset/
精彩评论