[Nut-upsuser] Behaviour of dummy-ups when port = file.xyz ?
Roger Price
roger at rogerprice.org
Thu May 5 13:34:08 BST 2022
I am trying to understand the new 2.8.0 dummy-ups man page. I see that the old
2.7.4 behaviour of looping on the operations specified in the file named by port
= file.dev in ups.conf has changed. The ".dev" in "file.dev" now means
once-only. The user may specify the old looping behaviour by either
1. Specifying port = file.seq
2. Specifying mode = dummy-loop in ups.conf
However the man page does not say what happens if port = file.xyz and there is
no mode declaration in ups.conf. All it says is "dummy is assigned by default
to files with other naming patterns that the driver could not classify".
Which dummy behaviour should I expect: dummy-once or dummy-loop ?
For reference I attach the Dummy Mode part of the man page.
Roger
###############################################################################
Dummy Mode
In this context, port in the ups.conf block defines a file name for the
dummy-ups to read data from. This can either be an absolute or a relative path
name. In the latter case the NUT sysconfig directory (i.e. /etc/nut,
/usr/local/ups/etc, …) is prepended.
Since NUT v2.8.0 two aspects of this mode are differentiated:
dummy-once reads the specified file once to the end (interrupting for TIMER
lines, etc.) and does not re-process it until the filesystem timestamp of the
data file is changed; this reduces run-time stress if you test with a lot of
dummy devices, and allows use/test cases to upsrw variables into the driver
instance — and they remain in memory until the driver is restarted (or the file
is touched or modified);
Since NUT v2.8.0 dummy-once is assigned by default to files with a *.dev
naming pattern.
dummy-loop reads the specified file again and again, with a short sleep
between the processing cycles; for sequence files using a TIMER keyword (see
below), or for use/test cases which modify file contents with external means,
this allows an impression of a device whose state changes over time.
Before NUT v2.8.0 this was the only aspect, so a simple dummy mode value
maps to this behavior for backwards compatibility.
Since NUT v2.8.0 dummy-loop is assigned by default to files with a *.seq
naming pattern, and dummy is assigned by default to files with other naming
patterns that the driver could not classify.
More information about the Nut-upsuser
mailing list