UPS shutdown command power off or halt

Status
Not open for further replies.

alexg

Contributor
Joined
Nov 29, 2013
Messages
197
I realize that this may not be FreeNAS specific question, but I'm wondering how you guys setup your NAS to run 24x7. BIOS supports AC Power Restore mode of "Last State". I see that FreeNAS sets up SHUTDOWN command in upsmon.conf as "/sbin/shutdown -p now". This means that when UPS forces the shutdown, it will power off the system and it will not come back up when power is restored.

Should I change this to "-h" (halt) instead of "-p"? What is the general opinion on this.

Thanks
 

cyberjock

Inactive Account
Joined
Mar 25, 2012
Messages
19,526
No, you're totally confused.

-p is all that you want for that. If you don't do a -p and choose for -h the box will halt. That is, the OS will turn off completely, but the box will still be powered on. That's not good when you are on the UPS.

On a loss of power, when you are on the UPS you absolutely want the box to power off. That's what it's *supposed* to do because you have no reliable power source. When power is restored you'll have to power-on the UPS manually(most likely), and you can turn the computer on then. But, reguardless of what choices you make, if the UPS goes dead, you *will* have to touch the UPS to turn it back on.

I'm not a fan of the computer ever powering on when power is restored. I want to power it on when I'm ready for it. Even if I'm doing it over IPMI. You can make your own choice for your situation. It is your server and your data lost if you make a bad choice. ;)
 

alexg

Contributor
Joined
Nov 29, 2013
Messages
197
Thanks for advice. Just need to teach my spouse which machine to power on in my basement lab when I'm not home.
 

stillka

Explorer
Joined
Nov 15, 2014
Messages
55
Hi,

I have installed an UPS and did a basic configuration, it looks OK:

[root@freenas] /usr/local/etc/nut# upsc Eaton_650i@localhost
battery.charge: 58
battery.runtime: 876
battery.type: PbAc
device.mfr: EATON
device.model: 5E 650i
device.type: ups
driver.name: usbhid-ups
driver.parameter.pollfreq: 30
driver.parameter.pollinterval: 2
driver.parameter.port: /dev/ugen0.4
driver.parameter.synchronous: no
driver.version: 2.7.3
driver.version.data: MGE HID 1.38
driver.version.internal: 0.39
input.voltage: 245.0
outlet.1.status: on
outlet.desc: Main Outlet
outlet.id: 1
outlet.switchable: no
output.frequency: 49.9
output.frequency.nominal: 50
output.voltage: 242.0
output.voltage.nominal: 230
ups.beeper.status: enabled
ups.delay.shutdown: 20
ups.firmware: 02.06.0017
ups.load: 22
ups.mfr: EATON
ups.model: 5E 650i
ups.power.nominal: 650
ups.productid: ffff
ups.start.battery: yes
ups.status: OL
ups.timer.shutdown: -1
ups.vendorid: 0463

[root@freenas] /usr/local/etc/nut# cat upsmon.conf
FINALDELAY 900
MONITOR Eaton_650i 1 upsmon okok master
NOTIFYCMD "/usr/local/sbin/upssched"
NOTIFYFLAG ONBATT SYSLOG+WALL+EXEC
NOTIFYFLAG LOWBATT SYSLOG+WALL+EXEC
NOTIFYFLAG ONLINE SYSLOG+WALL+EXEC
NOTIFYFLAG COMMBAD SYSLOG+WALL+EXEC
NOTIFYFLAG COMMOK SYSLOG+WALL+EXEC
NOTIFYFLAG REPLBATT SYSLOG+WALL+EXEC
NOTIFYFLAG NOCOMM SYSLOG+EXEC
NOTIFYFLAG FSD SYSLOG+EXEC
NOTIFYFLAG SHUTDOWN SYSLOG+EXEC
SHUTDOWNCMD "/sbin/shutdown -p now"
POWERDOWNFLAG /etc/killpower


[root@freenas] /usr/local/etc/nut# cat upssched.conf
CMDSCRIPT /usr/local/bin/custom-upssched-cmd
PIPEFN /var/db/nut/upssched.pipe
LOCKFN /var/db/nut/upssched.lock

AT NOCOMM * EXECUTE EMAIL
AT COMMBAD * START-TIMER COMMBAD 10
AT COMMOK * CANCEL-TIMER COMMBAD COMMOK
AT FSD * EXECUTE EMAIL
AT LOWBATT * EXECUTE EMAIL
AT ONBATT * START-TIMER ONBATT 900
AT ONBATT * EXECUTE EMAIL
AT ONLINE * CANCEL-TIMER ONBATT ONLINE
AT ONLINE * EXECUTE EMAIL
AT REPLBATT * EXECUTE EMAIL
AT SHUTDOWN * EXECUTE EMAIL


I did a test, unplugged the power cable, after 900s freenas initiated poweroff and went down but I have one problem:

- In freenas UPS service menu I have selected "Power Off UPS" but it doesn't work, UPS stay online after NAS box is down...

I have tested command "upsdrvctl shutdown" and it works:

[root@freenas] ~# upsdrvctl shutdown
Network UPS Tools - UPS driver controller 2.7.3
Network UPS Tools - Generic HID driver 0.39 (2.7.3)
USB communication driver 0.32
Using subdriver: MGE HID 1.38
Initiating UPS shutdown

I want shutdown UPS together with NAS box and AFTER electricity is restored UPS should start and power on the NAS box (in BIOS is set to power ON after electricity is ON)

This is a major feature because without it NAS box never start automatically when electricity is back online!

Thank you.
 
Last edited:
Status
Not open for further replies.
Top