Files
packages/net
Daniel F. Dickinson 90d3d1e9d0 nut: fix driver, server, and monitor reload/stop
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 <dfdpublic@wildtechgarden.ca>
2026-03-03 19:53:14 +01:00
..
2026-03-01 06:53:25 +01:00
2026-02-20 11:17:05 +02:00
2025-06-01 10:14:54 +03:00
2025-10-01 15:20:34 +02:00
2025-08-24 19:42:53 +03:00
2025-09-08 09:20:43 +02:00
2026-02-21 11:48:49 +01:00
2025-09-20 23:12:32 +08:00
2026-03-01 20:13:08 +00:00
2026-03-01 20:13:08 +00:00
2025-06-07 20:32:26 +02:00
2025-12-04 19:48:00 +08:00
2025-10-23 02:50:08 +08:00
2026-01-25 14:54:29 +02:00
2026-01-23 20:32:27 +02:00
2025-12-17 01:23:33 +02:00
2026-01-25 19:23:45 +02:00
2025-10-25 08:25:36 +03:00
2025-12-28 09:58:22 +02:00
2025-11-09 16:34:26 +01:00
2026-02-19 20:15:36 +02:00
2024-12-08 11:52:28 +02:00
2025-09-27 08:24:56 +03:00
2025-12-28 19:20:54 +08:00
2025-12-14 19:29:41 +08:00
2025-09-09 21:14:51 +08:00
2025-09-05 16:58:29 +08:00
2025-12-24 10:59:46 +01:00
2025-01-26 15:13:19 +01:00
2025-06-04 23:18:59 +03:00
2026-01-09 13:03:37 +01:00
2025-11-12 09:44:20 +02:00
2025-07-24 18:05:07 +03:00
2025-08-24 19:47:53 +03:00
2025-07-11 19:31:20 +08:00
2025-08-09 15:31:38 +08:00
2025-04-29 02:05:33 +01:00
2025-10-15 12:51:12 +02:00
2025-08-22 16:13:12 +03:00
2025-11-15 06:36:03 +02:00
2025-09-20 23:14:44 +08:00
2026-02-15 10:34:24 +02:00
2025-01-06 19:23:13 -08:00
2025-09-04 08:34:13 +02:00
2026-01-18 07:33:20 +02:00
2026-01-18 07:34:15 +02:00
2025-08-27 22:20:21 +03:00
2025-12-05 22:56:26 +01:00
2026-01-13 12:02:49 +01:00
2025-12-30 12:13:16 +02:00
2026-02-20 19:13:20 +00:00
2025-09-03 15:42:20 +02:00
2025-11-24 23:03:05 +01:00
2026-02-14 14:59:40 +02:00
2024-11-22 13:18:47 -08:00
2025-10-20 19:44:04 +02:00
2026-02-22 22:21:47 +02:00
2026-01-09 10:53:39 +01:00
2026-02-19 20:15:36 +02:00
2025-05-20 08:57:12 +02:00
2025-05-01 23:10:30 +02:00
2025-11-26 13:05:36 +01:00
2025-01-06 20:03:44 -08:00
2025-07-30 15:06:01 +08:00
2025-11-14 00:53:31 +08:00
2026-02-08 17:25:33 +08:00
2025-10-17 06:50:11 +03:00
2026-02-26 17:01:02 -08:00
2025-07-09 18:53:10 +08:00
2025-02-24 11:43:04 +01:00
2025-03-19 10:45:21 +01:00
2025-11-22 18:59:30 +02:00
2026-02-26 14:24:06 +02:00
2026-02-08 17:24:02 +08:00
2025-07-02 18:10:20 +08:00
2026-02-24 21:50:33 +02:00
2025-05-20 08:01:31 +02:00
2026-01-25 07:00:01 +02:00
2025-03-23 22:18:13 +01:00
2026-02-21 17:48:24 +02:00
2025-11-21 15:12:04 +01:00
2025-08-31 15:52:27 +08:00
2025-09-04 08:32:22 +02:00
2025-12-28 09:58:22 +02:00
2026-01-31 21:14:48 +02:00
2026-03-01 20:13:08 +00:00
2026-02-19 20:15:36 +02:00
2025-11-21 18:50:35 +02:00
2024-11-15 14:14:44 +01:00
2025-01-06 19:22:49 -08:00
2026-02-20 13:34:12 +02:00
2025-05-20 13:20:46 +02:00
2026-02-20 18:07:25 +01:00
2025-11-06 22:24:14 +02:00
2025-12-31 09:22:58 +02:00
2025-12-10 18:38:27 +01:00
2025-10-25 08:29:32 +03:00
2025-10-02 15:22:20 +02:00
2026-01-18 14:48:43 +08:00
2026-02-08 17:26:08 +08:00
2025-02-15 10:35:31 +02:00
2025-03-31 20:25:04 +03:00
2025-05-01 22:02:22 +02:00
2026-01-08 11:06:19 +02:00
2026-02-08 17:22:45 +08:00
2025-01-25 12:31:16 +02:00