[Nut-upsuser] Sweex 1000VA UPS
Arjen de Korte
nut+users at de-korte.org
Thu Nov 9 15:45:40 CET 2006
>> [ups_name]
>> driver = genericups
>> upstype = 7
>> port = /dev/ttyS0
>> desc = "Sweex 1000VA UPS"
> Ok, I tried this.
> The driver was loaded and..... the server shutdown immediately.
Lesson #1: Always first test whether the driver is producing good results
(you must be able to read the status from your UPS correctly), before
using it to shutdown a system.
> I had to attach a screen and a keyboard to the server and boot it in
> single user mode to disable nut in /etc/default/
Lesson #2: Unless you're sure of #1, don't put NUT in scripts that are
started automatically to prevent deadlocks... :-)
[...]
> This gives me:
>
> radius1:/var/log# ls -l /dev/ttyS0
> crw-rw---- 1 root dialout 4, 64 2005-02-26 07:39 /dev/ttyS0
>
> So, I guess not good. What is the correct chown?
> chown root:nut /dev/ttyS0 ?
>
> Could this be the reason of the instant shutdown?
No, not really. When the genericups driver fails to lock the serial port
(because of wrong permissions or it is locked by another process) it will
fail to startup.
Are you absolutely sure that the UPS is connected to /dev/ttyS0? For
'upstype=7' the signals for 'on battery' and 'low battery' are -CTS and
-DCD (both zero). I wouldn't be surprized at all if this is the same as
nothing connected to the port you're monitoring (although I can't test
that right now).
Note that the genericups driver is not able to detect whether or not
something is connected to the port it is monitoring, unlike many other
(somewhat) smarter protocols that are used by other drivers. This is due
to the limitations of the contact closure protocol used, not by the
driver.
> I don't want this to happen again. (radius)
Lesson #3: You really, REALLY, shouldn't experiment with a UPS on a live
system... :-)
When in doubt, it is always better to follow the instructions from the
genericups man page under the chapter 'TESTING COMPATIBILITY' to prevent
inadvertent shutdowns of your system.
Kind regards,
Arjen
More information about the Nut-upsuser
mailing list