[Nut-upsuser] How to shutdown macOS / mac OSX from Network UPS Tools client - NUT

Charles Lepple clepple at gmail.com
Sun Jun 9 19:55:49 BST 2019


On Jun 9, 2019, at 10:39 AM, Joe Gervasio wrote:
> Is there some way I can test my setup without having to deplete and recharge my UPS every iteration?    I have tried:
>       upsmon –c fsd   (on the master system)
> but all that happens is the iMac repeatedly declares ‘Executing automatic power-fail shutdown’ but does not actually do anything, and nor do any of the other systems :-(.  

Hmm, I'm not sure what would make it log the shutdown message repeatedly, but something occurs to me: you are probably running a recent enough version of macOS that won't let NUT write to /etc (per upsmon.conf: "POWERDOWNFLAG /etc/killpower"). I don't remember why we recommend /etc (maybe the assumption was that /var would get unmounted, but /var is not frequently on a separate partition on OS X). Maybe /var/run/killpower would be better?

> Clearly I’ve got something horribly wrong in my configurations, but being able to simulate on-battery, low-battery etc. from the UPS would really help the testing/diagnosis!
> 
'upsmon -c fsd' should be sufficient to test the shutdown procedure you are describing, but we also have a driver that reads what is essentially a NUT/upsc script file: https://networkupstools.org/docs/man/dummy-ups.html (ignore the parts about repeater mode).

In your case, upsmon is only going to be looking at the "ups.status" field. You can use the example in the "Implementation" section, probably with a longer timer value at the last test.

Happy to help - hope we can get this working smoothly. It is one of those things that should "just work", but some of our assumptions about the OS don't hold forever.


More information about the Nut-upsuser mailing list