[Nut-upsdev] Initialising UPS variables from ups.conf

Arjen de Korte nut+devel at de-korte.org
Mon Mar 7 11:42:12 UTC 2011


Citeren John Bayly <freebsd.ports op tipstrade.net>:

> Are there any plans to allow us to specify UPS variables in ups.conf, eg:

We already support this (as a hidden feature) since nut-2.4.0, where  
it is possible to set

     default.<variable> = value (default to value if UPS doesn't report this)
     override.<variable> = value (same, but override if reported by UPS)

But most likely, this is not what you need.

> [evo_s_3000]
>         driver = usbhid-ups
>         port = auto
>         desc = "Eaton Evolution S 3000"
>         vendorid = 0463
>         productid = ffff
>         ups.delay.shutdown = 120
>         ups.delay.start = 130

You probably missed the man page for the usbhid-ups driver. See  
'offdelay' and 'ondelay' under EXTRA ARGUMENTS in 'man 8 usbhid-ups'  
which are meant to do what you want. Using the  
'(default|override).ups.delay.(start|shutdown)' mechanism might also  
work, but this is not recommended.

> The reason I ask is that I'm using FreeBSD & gmirror and need to  
> extend the gracetime for the system to shutdown. For the moment,  
> I've created a custom shutdown script that is set in upsmon.conf  
> that does the job.

I doubt it.

> #!/usr/local/bin/bash
>
> /usr/local/bin/upsrw -s ups.delay.start=130 -u haltuser -p  
> somepassword evo_s_3000
> /usr/local/bin/upsrw -s ups.delay.shutdown=120 -u haltuser -p  
> somepassword evo_s_3000
>
> /sbin/shutdown -h +0

This most likely doesn't work, since the changed values of  
'ups.delay.start' and 'ups.delay.shutdown' won't stick between  
invocations of the driver. Only if you keep the driver running and  
send the instcmd 'shutdown.return' this might work, but this is not  
what happens if you call 'upsdrvctl shutdown' (where the driver is  
restarted with the -k flag). You *must* use ondelay and offdelay  
instead.

Best regards, Arjen
-- 
Please keep list traffic on the list (off-list replies will be rejected)




More information about the Nut-upsdev mailing list