How do I configure a UPS to initiate shutdown of VyOS?
I have a UPS device that is fully supported by Network UPS Tools (NUT) how do I set up NUT or something else for VyOS? The vendor provides an up to date .tgz, .rpm, and .deb as well.
I plan to have the UPS directly connected via USB to VyOS.
The VyOS device is a mini PC with an Intel Celeron processor and 4GB of RAM
I’m a home user with a straight forward setup but some of us work from home so I can’t afford to have the router down because of a corrupt filesystem after power loss
There is a theoretical risk of data corruption on open files but @Apachez is right, chances of disk corruption are very low as most processes run in RAM anyway.
Having said that, I totally get that you’d like to have an UPS in front of VyOS. Installing NUT from the .deb package is perfectly possible, see installation manual at 5. Installation instructions. Afterwards configure and you’re done.
Keep in mind that this package+config will cease to exist on VyOS image upgrade. You’ll need to repeat your steps.
Alternatively, you can create your own installation iso with the nut package embedded: Build VyOS — VyOS 1.5.x (circinus) documentation. You’d still have to do the configuration part of course.
Lastly, you could look into running NUT inside a container. Google for “network ups tools docker” and you’ll get loads of hits. VyOS has container support: Container — VyOS 1.5.x (circinus) documentation. Big plus is that this will survive image upgrade.
I run Nut on my NAS and it works well. The NAS is connected to UPS via a USB cable as you mentioned above. Upon detecting a power outage, the NAS will initiate a shutdown command and turn off.
For the router/firewall, agree with @Apachez and @marc_s that the risk is negligible/minimal. But if you go down the path what @marc_s mentioned would work.