Nut (UPS control) not working

Post new topic   Reply to topic    DD-WRT Forum Index -> Broadcom SoC based Hardware
Author Message
joaoabs
DD-WRT Novice


Joined: 01 Nov 2018
Posts: 15

PostPosted: Sat Jan 26, 2019 18:28    Post subject: Nut (UPS control) not working Reply with quote
Hi,

I'm using DD-WRT v3.0-r38100M kongac (12/27/2018) on a Netgear R7000.

I have all my IP stuff connected to an UPS, but the R7000 is the only device nearby with "intelligence" to manage the UPS.

Before I used to have a TP-1043ND with OpenWRT and was using NUT and upsdrvctl seamlessly.

I'm using the nut binaries obtained from "opkg install nut", however, even with the .conf files properly set-up, the nut isn't working. It seems the binaries are still poing towards the original / directory, and with Kong/entware it should be /opt, right?


Code:

root@mojito:/opt/etc/nut# upsd
Network UPS Tools upsd 2.7.4
fopen /var/run/nut/upsd.pid: No such file or directory
stat /etc/nut/upsd.conf: No such file or directory


Any idea how to overcome this one?

Cheers,
Sponsor
yoyoma2
DD-WRT User


Joined: 24 Sep 2016
Posts: 373

PostPosted: Sun Jan 21, 2024 21:25    Post subject: Reply with quote
TL;DR Yes Network UPS Tools (NUT) from Entware works just fine with dd-wrt. Only tested slave mode though.

Years ago I solved my dd-wrt USB thumb drives getting corrupted or simply worn out and dying by buying an actual USB HDD (WD My Passport) and formatting it ext4 which has journaling. Survived countless power failures trouble free.

I have a NAS with a UPS now so I also plugged dd-wrt's power into the UPS and it runs upsmon as a slave (the NAS is the master).

Plenty of tutorials online explain how to setup NUT. Just make sure when the tutorial tells you to set a temporary file somewhere that it isn't a read-only filesystem on dd-wrt. These variables needed tweaking.

POWERDOWNFLAG /tmp/var/run/killpower
SHUTDOWNCMD "startservice run_rc_shutdown"
PIPEFN /tmp/var/run/upssched.pipe
LOCKFN /tmp/var/run/upssched.lock

In my shutdown script a simple umount /opt had to be backgrounded and retried or upsmon itself would keep /opt busy as it waited for the SHUTDOWNCMD to finish.
Code:
( until [ ! -f /opt/etc/init.d/rc.unslung ]; do sleep 1 ; cd ; umount /opt; done ) &

Now after a power failure the email I get from dd-wrt tells me when the power came back but also when the power went away. I also get a warm feeling that my ext4 no longer needs to work to restore the filesystem to a clean state.
Display posts from previous:    Page 1 of 1
Post new topic   Reply to topic    DD-WRT Forum Index -> Broadcom SoC based Hardware All times are GMT

Navigation

 
Jump to:  
You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum
You cannot vote in polls in this forum
You can attach files in this forum
You can download files in this forum