Rilo Ravestein
Guru
- Joined
- Mar 6, 2014
- Messages
- 686
I use this workaround, but still get the , data for UPS is stale' messages
This is weird: when I went to edit the file to replace "ISTEN" by "LISTEN," that line changed as I moved the cursor across it: "ISTEN 0.0.0.0" became "LISTEN ......"Rather than simply adding "MAXAGE 25" by the means suggested above, I opened the upsd.conf file in an editor to see what was there already and found the single line
ISTEN 0.0.0.0
^
That is not a typo on my part: it's "ISTEN" rather than "LISTEN" -- the same both in /usr/local/etc/nut and in /etc/local/nut.
This is weird: when I went to edit the file to replace "ISTEN" by "LISTEN," that line changed as I moved the cursor across it: "ISTEN 0.0.0.0" became "LISTEN ......"
I was using the nano editor.
Can I ask a really dumb question?
Instead of mounting the root writable in the appliance, blah blah blah blah,
why would you not just go to the services->UPS->settings, and enter the "extra parameter" in there? This places it in the upsd.conf file for you. Persistently.
echo "MAXAGE 25" >> /use/local/etc/nut/upsd.conf mount -r / service nut restart
This is exactly what I did using the init scrip section of the GUI.Excuse me for necro'ing this threat, but i felt it would be better than creating a new one, seeing it'sthe exact same topic.
I was wondering, would it help putting
Code:echo "MAXAGE 25" >> /use/local/etc/nut/upsd.conf mount -r / service nut restart
in a startup script, untill FreeBSD fixed the bug?
and it worked fine? I like it.This is exactly what I did using the init scrip section of the GUI.
So I don't really reboot anymore so it's hard for me to say and I don't feel like rebooting just to test this out. But it has worked 1 out of 2 times. The time it didn't work I'm pretty sure it was a timing issue and I might put a sleep into the command to make it more consistent. I think it works great because I can forget about the issue and if I start seeing the log messages I already have the commands saved so I can easily execute them.and it worked fine? I like it.
Good hack, guys.
#!/bin/bash echo "MAXAGE 30" >> /etc/local/nut/upsd.conf service nut restart exit 0