You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Many NUT drivers accept the options ondelay, offdelay, and rebootdelay at startup. But unlike their runtime equivalent (ups.delay.start, ups.delay.reboot and ups.delay.shutdown), it seems that there is currently no project-wide standard or documentation to specify their acceptable uses. The most common behavior in existing drivers is to parse them at startup and convert them to ups.delay.*. But due to the lack of standard, it's not guaranteed and occasionally confusions among developers and users arise. For example, in bug #957, the riello_usb and riello_ser drivers attempt to read ups.delay.start, but this variable is not initialized anywhere in the driver, nor the driver accept ondelay, causing a NULL pointer dereference - instead, it requires default.ups.delay.start, much to the surprise of the user.
Another potential benefit is reducing code duplication - every driver has its own parser to do same thing over and over, if we can have a standardized delay option, main.c can do it automatically.
The standard should address the following issues.
Do we still really need {on,off,reboot}delay when we already have default.ups.delay.start to set these delays?
If we decided to keep {on,off,reboot}delay, when must a driver accept them as options? This needs to be a standard. My idea: if ups.delay.start is writable, the driver must have ondelay, etc.
Alternatively, perhaps the use of {on,off,reboot}delay should be discouraged and phased out. We can implemented the old options as a wrapper for the standardized default.ups.delay in main.c, only for backwards compatibility.
The text was updated successfully, but these errors were encountered:
Many NUT drivers accept the options
ondelay
,offdelay
, andrebootdelay
at startup. But unlike their runtime equivalent (ups.delay.start
,ups.delay.reboot
andups.delay.shutdown
), it seems that there is currently no project-wide standard or documentation to specify their acceptable uses. The most common behavior in existing drivers is to parse them at startup and convert them toups.delay.*
. But due to the lack of standard, it's not guaranteed and occasionally confusions among developers and users arise. For example, in bug #957, theriello_usb
andriello_ser
drivers attempt to readups.delay.start
, but this variable is not initialized anywhere in the driver, nor the driver acceptondelay
, causing a NULL pointer dereference - instead, it requiresdefault.ups.delay.start
, much to the surprise of the user.Another potential benefit is reducing code duplication - every driver has its own parser to do same thing over and over, if we can have a standardized delay option,
main.c
can do it automatically.The standard should address the following issues.
{on,off,reboot}delay
when we already havedefault.ups.delay.start
to set these delays?{on,off,reboot}delay
, when must a driver accept them as options? This needs to be a standard. My idea: ifups.delay.start
is writable, the driver must haveondelay
, etc.{on,off,reboot}delay
should be discouraged and phased out. We can implemented the old options as a wrapper for the standardizeddefault.ups.delay
inmain.c
, only for backwards compatibility.The text was updated successfully, but these errors were encountered: