-
-
Notifications
You must be signed in to change notification settings - Fork 334
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Definitive guide on how to setup upsmon to shutdown computer #2444
Comments
Hi, sounds great! One thing that caught my attention first is the single I see that your driver is based on recent NUT upstream codebase - it can be helpful to update the rest of the running services to use your build, if only to get the more advanced debugging and other features. I hope there are no fatal incompatibilities (ABI or protocol wise) between older/newer drivers and servers and clients - those would be unfortunate and unplanned - but better safe than sorry in this regard too. Especially with older I am not quickly sure what to make of this part:
It seems like the file exists but at the same time "No such file or directory". Wondering it there is a confusing filesystem object (e.g. a symlink pointing nowhere, so there is a directory entry but indeed nothing to read from) or some bug in 2.7.4 about this? Also not sure about the "disabling" part. It would make sense for Normally, |
By the way, the thread you've mentioned leads to some other investigations and write-ups about this, notably https://github.com/networkupstools/nut/wiki/Technicalities:-Work-with-PID-and-state-file-paths (noting that e.g. for |
…a non-NUT killpower file [#2444] Signed-off-by: Jim Klimov <jimklimov+nut@gmail.com>
Thanks for your prompt and detailed response.
I have seen the newer
Though it says that it is the newest version:
Until this point, my newer driver has been running fine. I monitor the data from it on another RPi running grafana. I do occasionally see this from nut-driver service:
I've tried to understand this issue, but it seems others have just ignored it.
Are there instructions somewhere for where I can find a newer release? Presently I do have a fork of
I am confused by this too. The file is there. I just assumed that something (magic string?) needs to be inside it:
I haven't tried testing with
Ah! It sounds like the file shouldn't be there. So I could try just deleting the killpower file and then see what happens...
This did magically happen once, but I don't know why and haven't been able to see it happen again. Here is a sample from syslog of the one time it worked:
It does support such an operation. When I run
I'll have to look into this more as I believe my UPS has an issue here. |
Thanks for your help! The RPi is shutting down reliably now! I had two issues; Fixing these two items fixed it. I guess it happened magically before I messed with (b) and maybe the file is (a) wasn't there. However, I don't see the shutdown sent to the UPS as specified in step 8 of the shutdown flow: Where can I find what the "commands" are that are sent to the UPS device? With debug=1 my driver logs each of the values that are retrieved. I would expect to see the Shutdown timer set to a value if it was told to shutdown. (For my driver, 0 means that the timer isn't running). These are the last entries in syslog before the shutdown:
|
For installing the current NUT codebase (e.g. your fork) over packaged versions (release/update cadence is the distro thing, can't help much here) with as much re-use of their build configuration as is deemed reasonable, check this wiki doc: https://github.com/networkupstools/nut/wiki/Building-NUT-for-in%E2%80%90place-upgrades-or-non%E2%80%90disruptive-tests This should in particular deliver a Your Note that it can be prudent to use a non-default location under For issue "b", beside changing the service type there should have been also a change of its behavior (running daemons "foregrounded" as far as NUT is concerned, e.g. by enabling debug with |
This is very useful, thank you. Wish I had found that earlier. I had to reverse engineer the existing NUT binaries to work out what I needed to put on the I created the man document for my driver, but I was never able to get documentation building. With the link above that specifies the packages, I hope to be able to build everything e2e.
I do have a /etc/init.d/nut-server poweroff step
I could have created it for manual experiments, following an example I found online. Now that I have removed it, I wonder if it is being created correctly. If it wasn't created, that would explain why the RPi is shutting down but not the UPS.
I did add the -D option, when I switched it to Simple. I did remove the -D but mis-spelt Fork. My next step is to try replacing my NUT deployment with a current version. There seems to be a lot to do to accomplish this. I need to install all the needed components, and what is confusing is, I need to make sense of the DEB scripts and how they are meant to be used. Feel free to close this issue now. If, and when, I get the time to work through replacing my NUT deployment and I run into issues, I will file a new issue. Thanks for your help. |
For Debian packaging, there's generally
The posted implementation seems to take care of telling the UPS to power off, sleeping and rebooting the server (if still powered); however it does not seem to ask if the FSD flag was raised in the first place. Also, somebody (who probably checks Also not sure if |
FWIW I was able to get to the newer version of NUT by moving from Debian 11
|
Hi All,
I have been having great fun writing a full NUT driver for a UPSPlus/EP-0136. This device is a HAT for Raspberry Pi, and communicates via i2c. My fork is here. I will see if I can submit it at some point.
Though the purpose of filing this issue is that I can not work out how to get upsmon to shutdown the RPi when it hits LB reliably.
I followed the NUT information/instructions 6.3. Configuring automatic shutdowns for low battery events.
And I searched for some of the errors I am seeing and see this thread on upsmon PID issues though I am unable to workout if this is (a) the problem or (b) how to work around it. I do sometimes see the
upsmon.pid
file appear and it is owned byroot:root
which is different to all the others (see below). But it doesn't appear all the time.Right now, it doesn't seem to want to become 'active'.
nut.conf:
upsd.conf (nothing configured, everything default)
ups.conf
upsd.users
upsmon.conf
nut-server status:
nut-driver status:
nut-monitor status:
PID files:
upsc pi:
The text was updated successfully, but these errors were encountered: