<feed xmlns='http://www.w3.org/2005/Atom'>
<title>packages/net/nut/files, branch master</title>
<subtitle>Mirror of packages feed</subtitle>
<id>https://git-03.infra.openwrt.org/feed/packages/atom?h=master</id>
<link rel='self' href='https://git-03.infra.openwrt.org/feed/packages/atom?h=master'/>
<link rel='alternate' type='text/html' href='https://git-03.infra.openwrt.org/feed/packages/'/>
<updated>2026-03-03T18:53:14Z</updated>
<entry>
<title>nut: fix no permissions to use USB UPS, and more</title>
<updated>2026-03-03T18:53:14Z</updated>
<author>
<name>Daniel F. Dickinson</name>
</author>
<published>2026-02-15T03:23:12Z</published>
<link rel='alternate' type='text/html' href='https://git-03.infra.openwrt.org/feed/packages/commit/?id=072f32fee3614c98dfa93141355155ec24a25dcc'/>
<id>urn:sha1:072f32fee3614c98dfa93141355155ec24a25dcc</id>
<content type='text'>
When a USB UPS is first configured, the permissions on the device under
`/dev/bus/usb` have not yet been set to allow the nut user access. This
resulted in errors such as:

Fri Feb 13 23:39:01 2026 daemon.debug upsd[3504]: [D1] mainloop: UPS
[eco550ups] is not currently connected, trying to reconnect
Fri Feb 13 23:39:01 2026 daemon.debug upsd[3504]: [D1] mainloop: UPS
[eco550ups] is still not connected (FD -1)
Fri Feb 13 23:39:03 2026 daemon.debug upsd[3504]: [D1] mainloop: UPS
[eco550ups] is not currently connected, trying to reconnect
Fri Feb 13 23:39:03 2026 daemon.debug upsd[3504]: [D1] mainloop: UPS
[eco550ups] is still not connected (FD -1)

or

Fri Feb 13 23:38:44 2026 daemon.err usbhid-ups[3083]: No matching HID
UPS found
Fri Feb 13 23:38:49 2026 daemon.warn procd: failed adding instance
cgroup for nut-server: No error information
Fri Feb 13 23:38:49 2026 daemon.err usbhid-ups[3115]: libusb1: Could not
open any HID devices: insufficient permissions on everything
Fri Feb 13 23:38:49 2026 daemon.err usbhid-ups[3115]: No matching HID
UPS found
Fri Feb 13 23:38:54 2026 daemon.warn procd: failed adding instance
cgroup for nut-server: No error information

and upsd would enter a procd crashloop.

We fix that by looking in `sysfs` (under `/sys/devices`) to find the
correct USB device and set its ownership and permissions to allow acces
to the user the driver is running under.

Copilot complained about a few things

* nut-server.init had potential word-splitting issues in various spots.
* it also had some commands missing an argument
* improved documentation was required to clarify a dependency
* an incorrect sed could mangle names as well as remove the intended
  name

Additionally, while fixing those issues the author noticed that the case
of multiple UPS devices with the same vendorid:productid were not
correctly handled. A check of the serial number, if provided, was added
along with a fallback to allowing NUT communications with all UPS
devices with a given vendorid:productid, if no serial number was given.

Improve efficiency and decrease McCabe complexity of
ensure_usb_ups_access, while also fixing Copilot complaints.

$@ in case is a problem, and we only handle the first parameter in any
event, so change $@ to "$1"

Copilot caught a missing 2&gt;&amp;1 and we silence some shellcheck
false positives

Signed-off-by: Daniel F. Dickinson &lt;dfdpublic@wildtechgarden.ca&gt;
</content>
</entry>
<entry>
<title>nut: comment and simplify server script</title>
<updated>2026-03-03T18:53:14Z</updated>
<author>
<name>Daniel F. Dickinson</name>
</author>
<published>2026-02-11T20:50:16Z</published>
<link rel='alternate' type='text/html' href='https://git-03.infra.openwrt.org/feed/packages/commit/?id=9cfa3f657d243ff47f90e320f562b4ccf7a9af34'/>
<id>urn:sha1:9cfa3f657d243ff47f90e320f562b4ccf7a9af34</id>
<content type='text'>
Attempt to de-mystify the nut-server initscript by adding comments
and factoring out some common code that adds to complexity of the
functions of which it is part.

Signed-off-by: Daniel F. Dickinson &lt;dfdpublic@wildtechgarden.ca&gt;
</content>
</entry>
<entry>
<title>nut: stop de-configured ups</title>
<updated>2026-03-03T18:53:14Z</updated>
<author>
<name>Daniel F. Dickinson</name>
</author>
<published>2026-01-23T04:26:23Z</published>
<link rel='alternate' type='text/html' href='https://git-03.infra.openwrt.org/feed/packages/commit/?id=688c20bc78ac0b5d4857cfb162b3b0ef6e50dc26'/>
<id>urn:sha1:688c20bc78ac0b5d4857cfb162b3b0ef6e50dc26</id>
<content type='text'>
Ensure that when a ups is removed from the configuration that its
driver instance is stopped.

Signed-off-by: Daniel F. Dickinson &lt;dfdpublic@wildtechgarden.ca&gt;
</content>
</entry>
<entry>
<title>nut: fix driver, server, and monitor reload/stop</title>
<updated>2026-03-03T18:53:14Z</updated>
<author>
<name>Daniel F. Dickinson</name>
</author>
<published>2026-01-11T10:41:48Z</published>
<link rel='alternate' type='text/html' href='https://git-03.infra.openwrt.org/feed/packages/commit/?id=90d3d1e9d013e9cc3fec755f46826d8feab94cfa'/>
<id>urn:sha1:90d3d1e9d013e9cc3fec755f46826d8feab94cfa</id>
<content type='text'>
Updated configuration was not being applied after config change. This
was due to the means used to do the daemon reloads.

Closes #28298 "Drivers not restarted on config change"

Enable creating PID files for the server, driver, and monitor daemon
processes. This allows to use NUT's built-in facilities for signalling
the daemon's.

For server, when reloading:
1. Check if upsd is running
   1. If not, start it.
   2. If it is send reload signal to upsd
2. For each driver:
   1. Check if the driver is running
      1. If it is, send reload-or-exit signal to driver
      2. If driver is not running, start it
3. Attempt to start server (upsd and drivers) if service was stopped.

For server, when stopping:
1. Check if upsd is running
   1. If it is send stop signal to upsd
   2. Ensure it really is stopped
2. For each driver:
   1. Check if the driver is running
      1. If it is, send stop signal to driver
      2. If driver is still running, stop it.
3. If the server process is active (even with not upsd or drivers),
   stop it.

For monitor, send the reload signal on config change, with fallback to
stopping and starting the daemon.

Change the names of variables and functions to make it more clear what
is being acted on, configured, or otherwise touched.

Avoid confusing messages in syslog

* Avoid attempting to remove a procd server instance that does not exist
  as doing so results in confusing/scary messages in syslog, such as:

  Command failed: ubus call service delete
  { "name": "nut-server", "instance": "upsd" } (Not found)

In NUT some models of UPS use shutdown_delay rather than offdelay, and
yet others use usd for the same purpose. shutdown_delay and usd were
previously not available in the list of available driver options, so
add them.

Signed-off-by: Daniel F. Dickinson &lt;dfdpublic@wildtechgarden.ca&gt;
</content>
</entry>
<entry>
<title>nut: add linting and fix whitespace and typos</title>
<updated>2026-03-03T18:53:14Z</updated>
<author>
<name>Daniel F. Dickinson</name>
</author>
<published>2026-01-11T10:36:43Z</published>
<link rel='alternate' type='text/html' href='https://git-03.infra.openwrt.org/feed/packages/commit/?id=7eafd0ada63825d560b8ea6ef3dd9230926e5e57'/>
<id>urn:sha1:7eafd0ada63825d560b8ea6ef3dd9230926e5e57</id>
<content type='text'>
shellcheck is a useful linter if a bit pedantic and overzealous so
add overrides to silence false positives

Also, fix issues found by the linting.

* misspelling meant initscript could skip updating configuration in
  certain circumstances
* minor: assignment of the result of execution as the time of creating
  local. This has been separated.

Fix whitespace and comment typos
Fix typo in Config.in option text
* This is cosmetic, but user-facing (for users building via SDK or
  buildroot).

Signed-off-by: Daniel F. Dickinson &lt;dfdpublic@wildtechgarden.ca&gt;
</content>
</entry>
<entry>
<title>nut: fix typo in nut_serial.hotplug (fix #21504)</title>
<updated>2025-08-24T18:48:56Z</updated>
<author>
<name>Sebastian Hamann</name>
</author>
<published>2025-08-19T11:53:27Z</published>
<link rel='alternate' type='text/html' href='https://git-03.infra.openwrt.org/feed/packages/commit/?id=012cfe59858ae53314229a832c015cea23589d5c'/>
<id>urn:sha1:012cfe59858ae53314229a832c015cea23589d5c</id>
<content type='text'>
Signed-off-by: Sebastian Hamann &lt;code@ares-macrotechnology.com&gt;
</content>
</entry>
<entry>
<title>nut: add cable type nut driver config</title>
<updated>2022-05-13T04:53:27Z</updated>
<author>
<name>Rob J. Epping</name>
</author>
<published>2022-05-11T21:17:06Z</published>
<link rel='alternate' type='text/html' href='https://git-03.infra.openwrt.org/feed/packages/commit/?id=67e49b7e0e837f8b8677b7ac70321879a941b928'/>
<id>urn:sha1:67e49b7e0e837f8b8677b7ac70321879a941b928</id>
<content type='text'>
at least driver apcsmart-old (maybe more) allow for specifying the
type of cable used. My old UPS does will not function when cable type
is not specified.

This will add support for configuration option 'cable'

Signed-off-by: Rob J. Epping &lt;epping@renf.us&gt;
</content>
</entry>
<entry>
<title>nut: refactor upssched uci-defaults script</title>
<updated>2022-01-12T00:27:19Z</updated>
<author>
<name>Pascal Coudurier</name>
</author>
<published>2022-01-04T13:12:31Z</published>
<link rel='alternate' type='text/html' href='https://git-03.infra.openwrt.org/feed/packages/commit/?id=f9bbc5173c18dfcec434c73c69eae9d312b27c90'/>
<id>urn:sha1:f9bbc5173c18dfcec434c73c69eae9d312b27c90</id>
<content type='text'>
Add checks not to overwrite defaultnotify options in the nut-sendmail-notify fashion.
Use lists for defaultnotify instead of option.
Add check not to overwrite notifycmd if already defined.
upssched-cmd script must not be called directly, it is called by the upssched binary with needed arguments.

Signed-off-by: Pascal Coudurier &lt;coudu@wanadoo.fr&gt;
</content>
</entry>
<entry>
<title>nut: refactor nut-monitor uci config file</title>
<updated>2022-01-12T00:27:19Z</updated>
<author>
<name>Pascal Coudurier</name>
</author>
<published>2022-01-04T13:11:14Z</published>
<link rel='alternate' type='text/html' href='https://git-03.infra.openwrt.org/feed/packages/commit/?id=0f91594e2ae996f18e78ddc232340314d30c59cc'/>
<id>urn:sha1:0f91594e2ae996f18e78ddc232340314d30c59cc</id>
<content type='text'>
Convert notifyflags options to lists as supported by the init script, so multiple options can be chosen.
Add SYSLOG default option to individuals notifyflags instead of deprecated flag 1|0.
Add comment for defaultnotify and individuals notifyflags about possible values.

Signed-off-by: Pascal Coudurier &lt;coudu@wanadoo.fr&gt;
</content>
</entry>
<entry>
<title>nut: fix typo in nut-monitor init script</title>
<updated>2022-01-12T00:27:19Z</updated>
<author>
<name>Pascal Coudurier</name>
</author>
<published>2022-01-04T13:07:59Z</published>
<link rel='alternate' type='text/html' href='https://git-03.infra.openwrt.org/feed/packages/commit/?id=a46fd908dfb4d2d33f7bec46df9244d712b75d88'/>
<id>urn:sha1:a46fd908dfb4d2d33f7bec46df9244d712b75d88</id>
<content type='text'>
This fixes a typo in the nut-monitor init script when building config file from uci config.

Signed-off-by: Pascal Coudurier &lt;coudu@wanadoo.fr&gt;
</content>
</entry>
</feed>
