Roger Price
2022-May-05 12:34 UTC
[Nut-upsuser] Behaviour of dummy-ups when port = file.xyz ?
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.
Jim Klimov
2022-May-10 15:04 UTC
[Nut-upsuser] Behaviour of dummy-ups when port = file.xyz ?
Hi, sorry for missing this in my mailbox. The short answer is that a port=file.xyz would now loop like before (which was the only mode then). Since 2.8.0 there are 3 modes in setting as well as reports in `upsc` etc.: 2 for explicit behavior (dummy-once as default for *.dev and dummy-loop as default for *.seq) and one implicit "dummy" that goes for legacy default and least surprise in general, so looping. But over eons this one might change or not. Jim On Thu, May 5, 2022, 14:34 Roger Price <roger at rogerprice.org> wrote:> 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. > > _______________________________________________ > Nut-upsuser mailing list > Nut-upsuser at alioth-lists.debian.net > https://alioth-lists.debian.net/cgi-bin/mailman/listinfo/nut-upsuser >-------------- next part -------------- An HTML attachment was scrubbed... URL: <http://alioth-lists.debian.net/pipermail/nut-upsuser/attachments/20220510/d339c48f/attachment.htm>