Small but important tweaks to fix the operation of the nut initscripts
and hotplug scripts. All hail shellcheck and proofreading and
dogfooding.
Signed-off-by: Daniel F. Dickinson <cshored@thecshore.com>
Fix a crashloop under procd when attempting to bind
to any address when no interfaces are yet available.
Signed-off-by: Daniel F. Dickinson <cshored@thecshore.com>
Various path and permissions fixes to properly allow nut-server and nut-monitor to
start properly.
Signed-off-by: Daniel F. Dickinson <cshored@thecshore.com>
Avoid potential issues with space or other strangeness by
quoting filenames through the initscripts.
Signed-off-by: Daniel F. Dickinson <cshored@thecshore.com>
Instead of making POWERDOWNFLAG an uci option the user can
only change it via initscript edits. This avoids chance for users
to miss the required change to nut-driver when setting an UCI option
for nut-monitor which results in failure to do FSD on the UPS.
Signed-off-by: Daniel F. Dickinson <cshored@thecshore.com>
By default use a non-privileged user that is different than
the server or driver (when they are running non-privileged).
This is recommended by upstream.
Signed-off-by: Daniel F. Dickinson <cshored@thecshore.com>
Forced shutdown of the UPS was not actually happening before
due to lack of specific commands doing the shutdown. This
(and the nut-driver initscript) fix that.
Signed-off-by: Daniel F. Dickinson <cshored@thecshore.com>
This fully procdifies nut-monitor, which fixes some issues with
very slow restarts (due to /lib/functions/procd.sh using a very
long delay for non-native scripts doing restart) as well as gives
respawning, etc.
Signed-off-by: Daniel F. Dickinson <cshored@thecshore.com>
nut-monitor failed to create required dir /var/etc/nut, as
well as failing to set appropriate user on the directory and
conf files. Fixing this closes
https://github.com/openwrt/packages/issues/6644
Signed-off-by: Daniel F. Dickinson <cshored@thecshore.com>
Use /var/run/nut as statepath and set appropriate owner
and permissions on /var/run/nut in order to avoid pidfile
for nut being world-readable.
Signed-off-by: Daniel Dickinson <lede@cshore.thecshore.com>
With a LuCI app (of which I have one written) ucification makes
sense (and is in fact needed), so ucify the initscripts.
Also, rather than making selection of things to include an image
a matter of selecting compile-time config options, make optional
things into seperate packages that are built in default builds,
and leave selection of what to include or not up to the user
(e.g. using ImageBuilder, or adding packages via opkg).
Signed-off-by: Daniel Dickinson <lede@cshore.thecshore.com>
An older version of nut is in oldpackages. This commit is based on that
package and bumps the version to the latest release along with unifying
the server and client packages. More build options are provided for any
custom configuration but the defaults provide a working client and
server install which only needs a UPS driver. Drivers still build as
individual packages to minimise bloat. SSL support has also been added.
Signed-off-by: Martin Rowe <cyanidium@users.noreply.github.com>