Hi!
As I am a noob about UPS stuff, I may now come with silly questions. So take a deep breath
Background
On my Qnap NAS the manual tells I have two options for what happens when the UPS tells the NAS that there is a power failure:
-
Power off: If the NAS is powered off, it will remain off after the power is on again.
-
Auto-protection mode: If the NAS is in auto-protection mode, all normal service’s gets disabled and it stops writing to the disc, then it will resume to normal operation after the power is on again.
Auto-protection mode
-
a) If it has not yet been powered off, the UPS batteries have not run out of charge, the system automatically resumes to its previous state (or reboots, it seem to be different depending on the Qnap model). On my both NAS in the GUI it say “*Auto-protection: the NAS will stop all running services and unmount all volumes to protect your data. When the power restores, the NAS will reboot and resume to its previous state.”
-
b) If the UPS batteries run out of charge and cuts power to the NAS, the BIOS setting (or system settings) automatically resumes the system to its previous state, eg. it boots up again, when power is restored (if BIOS is set up to resume previous state, eg. turned on, in this case).
I was thinking I would use the NAS as the Primary (connected with USB to the UPS) and my main and backup iPfires as secondaries that get info from the NAS.
Problem
When i read the Wiki * Network UPS Tools (NUT)
- Detailed NUT Configuration I believe there is in upsmon.conf the setting SHUTDOWNCMD “/sbin/shutdown -h +0” that the wiki say “this command will be triggered if UPS sends the BL (Battery Low) flag.” and as I understand it will shutdown the system and turn it off.
When power is on again, it will stay off as that was the last state after power loss as I willfully turned it off. I have not found a BIOS settings on my iPfire PC to always turn on when AC power is resumed, but my BIOS is set up to resume previous state. Even if I could in BIOS set it to “always turn on when AC power is resumed”, it would not work it it turns it self off and power failure resolves before the UPS batteries have run out of charge.
What I would like
Somehow replace “/sbin/shutdown -h +0” with something that puts the system “on hold”, disables services (maybe only one process that monitors NAS and reboots?) and stops reading/writing to hard drive, and if the UPS via the NAS says power is on again it reboots the system (or resumes to normal state if that is possible).
If the UPS batteries run out of charge and cuts power, the BIOS setting “Restore previous state on AC/Power Loss” will boot the system.
So even if there is a short or long power failure, the iPfire will be safe and always boot up again.
Is that possible somehow?