[Nut-upsuser] Early shutdowns and 2.6.5-1 package for Windows

FredericBohe at Eaton.com FredericBohe at Eaton.com
Fri Sep 14 13:43:03 UTC 2012


> From: nut-upsuser-bounces+fredericbohe=eaton.com at lists.alioth.debian.org [nut-upsuser-bounces+fredericbohe=eaton.com at lists.alioth.debian.org] on behalf of Denis Serov [dns-srv at yandex.ru]
> Sent: Thursday, September 13, 2012 9:19 PM
> To: nut-upsuser at lists.alioth.debian.org
> Subject: [Nut-upsuser] Early shutdowns and 2.6.5-1 package for Windows
> 
> Hello NUT Team!

Hello Denis,

> 
> I am testing the early shutdowns in NUT 2.6.5-1 package for Windows (Windows 7 x64).
> 
> My configuration files:
> 
> upsmon.conf
> RUN_AS_USER upsmon
> MONITOR upsa at 192.168.10.200 1 upsmon pass master
> MINSUPPLIES 1
> SHUTDOWNCMD "/sbin/shutdown -h +0"
> NOTIFYCMD "upssched.exe"
> POLLFREQ 5
> POLLFREQALERT 5
> HOSTSYNC 15
> DEADTIME 15
> POWERDOWNFLAG "C:\\NUT\\killpower"
> NOTIFYMSG COMMOK "Communications with UPS %s established"
> NOTIFYMSG COMMBAD "Communications with UPS %s lost"
> NOTIFYFLAG COMMOK SYSLOG+EXEC+WALL
> NOTIFYFLAG COMMBAD SYSLOG+EXEC+WALL
> RBWARNTIME 43200
> NOCOMMWARNTIME 300
> FINALDELAY 5
> 
> upssched.conf
> CMDSCRIPT "cmd.exe -C C:\\NUT\\1.cmd"

I guess it's /C (not -C).

> PIPEFN "C:\\NUT\\pipefn.lock"
> LOCKFN "C:\\NUT\\lockfn.lock"
> AT COMMBAD upsa at 192.168.10.200 START-TIMER upslost 10
> AT COMMOK upsa at 192.168.10.200 CANCEL-TIMER upslost
> 
> 1.cmd
> echo %1 > 1.txt
> 
> I have found some issues I would like to report.
> 
> 1. NOTIFYCMD parameter is not specified
> NUT doesn’t start UPSSCHED tool (as I remember, Linux version do it by default).

upssched is called by upsmon when a NOTIFYFLAG set to EXEC happens. It is not started by NUT service (even on Linux).

> 
> 2. PIPEFN parameter is invalid (its value is a file in non-existed directory)
> UPSMON logs an error:
>   25.222443     pollups: upsa at 192.168.10.200
>   25.229443     get_var: upsa at 192.168.10.200 / status
>   25.238444     Poll UPS [upsa at 192.168.10.200] failed - Data stale
>   25.248444     Current power value: 1
>   25.254444     Minimum power value: 1
> Failed to connect to parent and failed to create parent: No error [The system cannot find the path specified. ]

In fact PIPEFN is ignored on Windows version, anyway you still must have something (anything) set for it.

> 
> There is no proper record in Event Viewer. 2.6.0-1 version writes different warnings and errors there. They helps to understand what is wrong.
> That is quite difficult now because of total silence.
> 
> 3. All parameters are valid
> Two instances of UPSSCHED.EXE are starting (why two?) and they are not stopping (I was waiting about 5 minutes). CMDSCRIPT is not executed, I cannot find its activity.
> Moreover, these processes are not stopped when Network UPS Tools service is stopped.
> 
> UPSMON outputs a lot of strings like “read confirmation failed, trying again”, “addchar: discarding invalid character (0x00)!”
> 
>   40.276304     pollups: upsa at 192.168.10.200
>   40.281304     get_var: upsa at 192.168.10.200 / status
>   40.289305     Poll UPS [upsa at 192.168.10.200] failed - Data stale
>   40.298305     Current power value: 1
>   40.303305     Minimum power value: 1
> read confirmation failed, trying again
> read confirmation got []
> read confirmation failed, trying again
>   45.307592     pollups: upsa at 192.168.10.200
>   45.312592     get_var: upsa at 192.168.10.200 / status
>   45.319592     Poll UPS [upsa at 192.168.10.200] failed - Data stale
>   45.328593     Current power value: 1
>   45.333593     Minimum power value: 1
> read confirmation failed, trying again
> read confirmation failed, trying again
> read confirmation failed, trying again
> read confirmation got []
> Timer daemon started
> addchar: discarding invalid character (0x00)!
> addchar: discarding invalid character (0x00)!
> 
> Sometimes I see the strings with garbage inside, like repeated using of released memory.

Good point Denis.
There is a regression on Windows version. It is related to a security issue fixed a while ago. Some Linux modifications did not make it to Windows code.
Can you try this binary :

fbohe.free.fr/upssched.exe

Let us know if this fix your issue.


> 
> Thanks,
> Denis

Thank you for your usefull bug report.
Fred

--
Eaton Opensource Team - http://opensource.eaton.com



-----------------------------

-----------------------------




More information about the Nut-upsuser mailing list