Commit Graph

38 Commits

Author SHA1 Message Date
Daniel F. Dickinson 45c95e8629 nut: Fix NUT CGI startup script
Commit c1aa1f784c which backported
a number of fixes from master, missed one fix for nut-cgi.  If
nut-cgi is installed standalone or nut-cgi starts before nut-server
(the default in 18.04.5) then the configuration file directory does
not get create and therefore there is no CGI configuration file.
This commit fixes that.

Closes: #10687

Signed-off-by: Daniel F. Dickinson <cshored@thecshore.com>
2019-12-21 05:30:40 -05:00
Daniel F. Dickinson c1aa1f784c nut: Bump PKG_RELEASE
Signed-off-by: Daniel F. Dickinson <cshored@thecshore.com>
2019-08-27 01:22:41 -04:00
Daniel F. Dickinson 361e6aaaab nut: Handle FSD properly
Make sure we force shutdown of UPS only when we should, and when
we should that shutdown happens.

Signed-off-by: Daniel F. Dickinson <cshored@thecshore.com>
2019-08-27 00:56:42 -04:00
Daniel F. Dickinson a2ab989c12 nut: Fix init actions (server/driver)
The server and driver were not starting/restarting reliably. In
addition on interface changes NUT got very confused.  So we fix
handling of restarts and add a reload trigger for interface
changes.

Signed-off-by: Daniel F. Dickinson <cshored@thecshore.com>
2019-08-27 00:53:42 -04:00
Daniel F. Dickinson ef0bd01409 nut: Fix extra diver params config
Extra parameters for the UPS driver were not being handled correctly.
Fix that (was wrong variable name).

Signed-off-by: Daniel F. Dickinson <cshored@thecshore.com>
2019-08-27 00:49:46 -04:00
Daniel F. Dickinson 77519cd204 nut: Fix permissions with runas
Fix directory and conf file creation and owner/mode setting
for when running as non-root.

Signed-off-by: Daniel F. Dickinson <cshored@thecshore.com>
2019-08-27 00:47:16 -04:00
Daniel F. Dickinson e976846521 nut: Fix statepath handling
The statepath was getting the wrong permission and/or not created
at the right time.  This commit includes fixes for handling the
statepath (typically /var/run/nut).

Signed-off-by: Daniel F. Dickinson <cshored@thecshore.com>
2019-08-27 00:47:16 -04:00
Daniel F. Dickinson 5f69f9a065 nut: Fix unset of runas user (ups server)
Running as non-root was failing due to misplace local keyword
causing runas to be unset from calling value.

Signed-off-by: Daniel F. Dickinson <cshored@thecshore.com>
2019-08-27 00:46:51 -04:00
Daniel F. Dickinson ccdec71b5c nut: Fix bad check for conf exists
We were `cat`ing the file instead of just checking for non-empty
existance.  Fix that.

Signed-off-by: Daniel F. Dickinson <cshored@thecshore.com>
2019-08-26 23:48:49 -04:00
Daniel F. Dickinson c963f0c297 nut: Fix upsmon init actions
1) For upsmon start and stop were at wrong position in rc.d
2) Stop needs more than just killing the procd instead but rather
needs a  stop command to be issued.
3) Interface up/down was causing not to enter a crashloop (we fix this
with procd trigger on interface changes).

Signed-off-by: Daniel F. Dickinson <cshored@thecshore.com>
2019-08-26 23:43:16 -04:00
Daniel F. Dickinson d06bd2d7e3 nut: Fix unset of runas user (upsmon)
Running as non-root was failing due to misplace local keyword
causing runas to be unset from calling value.

Signed-off-by: Daniel F. Dickinson <cshored@thecshore.com>
2019-08-26 23:38:10 -04:00
Daniel F. Dickinson 020dfd4541 nut: Remove unecessary libwrap dependency
CONFIG_ARGS has --without-wrap so libwrap as a dependency is
extraneous as it is not actually used.

Signed-off-by: Daniel F. Dickinson <cshored@thecshore.com>
2019-08-26 23:18:05 -04:00
Daniel F. Dickinson 8f41fa7f82 nut: Default to run as root but fix alt runas
Since the new hotplug script in master was not backport (new feature),
for 18.06 branch revert the old behavior of running NUT daemons and
drivers as root by default to avoid permisions problems, but backport
fix the support for running as another user for those who can set the
appropriate permissions on the USB (or other) device.

Closes: #7742

Signed-off-by: Daniel F. Dickinson <cshored@thecshore.com>
2018-12-28 16:18:26 -05:00
Daniel F. Dickinson bb1b12733e nut: Backport fixes from master
Backport and squash the following commits from master:

  5790053eb nut: Add missing conffiles
  ceff68837 nut: Reorganize nut-server to clarify nut-driver
  f6a2a97d2 nut: Use 'real' procd init for nut-monitor
  918a62f91 nut: Make FSD really work
  a2f64b3ba nut: Reduce user error with POWERDOWNFLAG
  461393810 nut: Use quotes around filenames
  1b6dbe7a7 nut: Remove duplicate/extraneous lines
  0a49d0ffb nut: Fix checking for path before it exists
  3b5a8eee8 nut: Various startup fixes for monitor and server
  44e57d4bd nut: Fix variables for NUT drivers
  36fd59dc7 nut: Fix extraneous config_get
  192b0f164 nut: Fix a typo in setting a driver parameter
  f48b060fa nut: Fix upsd runs as root

And bump PKG_RELEASE

Signed-off-by: Daniel F. Dickinson <cshored@thecshore.com>
2018-12-11 07:19:15 -05:00
Daniel F. Dickinson af0ad2ce0d nut: Fix for nut-upsmon without nut-server
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>
(cherry picked from commit 98fdf16ecb)
2018-08-02 19:27:33 +03:00
Daniel F. Dickinson 6a5a257fc0 nut: Update my email
Signed-off-by: Daniel F. Dickinson <cshored@thecshore.com>
(cherry picked from commit b4fe49d2b2)
2018-08-02 19:27:33 +03:00
Eneas U de Queiroz 41a9bf21f0 nut: Add PKG_FIXUP:=autoreconf
We need to force this since a *.m4 file is patched.

Signed-off-by: Eneas U de Queiroz <cote2004-github@yahoo.com>
(cherry picked from commit 6543859dab)
2018-08-02 19:27:33 +03:00
Eneas U de Queiroz 6576f7be92 nut: added compatibility with openssl-1.1
Also added a fix in a check for empty string.

Signed-off-by: Eneas U de Queiroz <cote2004-github@yahoo.com>
(cherry picked from commit 1a9a7cc280)
2018-08-02 19:27:33 +03:00
Karl Palsson 66921d1226 net/nut: Fix typo is serial config option
Fixes: 5503dac806 "Add back serial support"
Reported-by: Znevna on irc
Signed-off-by: Karl Palsson <karlp@tweak.net.au>
2017-09-11 17:19:10 +00:00
Etienne Champetier 4006865ae8 treewide: run "make check FIXUP=1"
fix Makefile chmod (644)
replace MD5SUM with HASH
add PKG_MIRROR_HASH when PKG_SOURCE_PROTO:=git

(PKG_SOURCE_PROTO:=svn tarballs are not reproducible for now)

Signed-off-by: Etienne Champetier <champetier.etienne@gmail.com>
2017-08-29 21:41:14 -07:00
Daniel Dickinson 604f22ee69 net/nut: Ship upsset.conf for nut-cgi
Per user request ship the sample upsset.conf file so that
upsset functionality can be used with nut-cgi

Signed-off-by: Daniel Dickinson <lede@cshore.thecshore.com>
2017-01-11 18:59:15 -05:00
Daniel Dickinson a69c25d5e3 net/nut: Avoid building with libwrap when present
We don't want non-deterministic builds do turn off
libwrap in configure options.

Signed-off-by: Daniel Dickinson <lede@cshore.thecshore.com>
2017-01-11 18:55:32 -05:00
Daniel Dickinson b27c7fd64b net/nut: Make myself maintainer per private mail
Current maintainer (Martin Rowe) offered to hand over
maintership because I'm interested in doing more with
the package than he requires for his own use, so he
felt it made sense for me to maintain the package.
I accepted, hence this commit.

Signed-off-by: Daniel Dickinson <lede@cshore.thecshore.com>
2017-01-11 18:55:19 -05:00
Daniel Dickinson c00d89593e net/nut: Fix '/var/run' world readable warning
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>
2017-01-11 18:54:51 -05:00
Daniel Dickinson c94e334c4e net-nut: Add UPS notifications via sendmail
Add option to send email notification via sendmail
(or replacement).

Signed-off-by: Daniel Dickinson <lede@cshore.thecshore.com>
2017-01-11 18:54:40 -05:00
Daniel Dickinson 5503dac806 net/nut: Add back serial support
It looks like serial support was accidentally dropped due to missing
pieces on Config.in and Makefile.  Add back serial support by fixing
that.

Signed-off-by: Daniel Dickinson <lede@cshore.thecshore.com>
2017-01-11 18:54:29 -05:00
Daniel Dickinson c1d26bacdf net/nut: Protect CGI via HTTP Basic Auth
When using uhttpd (the default), protect NUT CGI
via HTTP Basic Auth.

Signed-off-by: Daniel Dickinson <lede@cshore.thecshore.com>
2017-01-11 18:54:16 -05:00
Daniel Dickinson a23c4e85c5 net/nut: Build optional separate packages and ucify
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>
2017-01-11 18:53:58 -05:00
Marty R 35c2fa24d8 net/nut: Remove whitespace before conffiles
Closes #2652

Signed-off-by: Martin Rowe <martin.p.rowe@gmail.com>
2016-05-03 11:20:10 +09:00
Marty R a72cb6c955 nut: upstream version bump
Version bump package to latest v2.7.4 code from upstream. No changes needed for packaging.
2016-03-18 22:41:47 -07:00
Marty R 064d84ab90 nut: add dev headers, nut-web-cgi and nut-avahi-service, bugfix
Headers are required by collectd as mentioned in #1801. This is the nut portion based on dwmw2@d636841cd1d1dfab04cb509520c082738ddfb2ea
Happy to merge with 15.05 as per #1803.
Signed-off-by: David Woodhouse <David.Woodhouse@intel.com>
[martin.p.rowe@gmail.com: condensed InstallDev lines]

Added package nut-web-cgi based on demorfi@7e340f47944ff4a9c49d3b1dc6c1d9d965cd344c. Closes #1614.
Pending signoff by @demorfi
[martin.p.rowe@gmail.com: simplified implementation, no changes to Config.in]

Added package nut-avahi-service similar to other implementations in #618
Bugfix to remove redundant NUT_DRIVER_SERIAL config
Bugfix to make UPSLOG config actually install (requires PKG_RELEASE bump)
Some code tidy-ups
Signed-off-by: Martin Rowe <martin.p.rowe@gmail.com>
2015-10-03 18:11:28 -07:00
Hanson Wong 9fa55147c4 nut: Fix required dependencies. 2015-09-20 22:48:29 +10:00
Marty R d5c824e8bf nut: remove patch for old automake version
tools/automake was updated to 1.15 which removed this bug; patch no longer needed.

Signed-off-by: Martin Rowe <martin.p.rowe@gmail.com>
2015-05-06 20:58:02 -07:00
Marty R b195c1c367 nut: Update to 2.7.3
Updated the package to the latest upstream version.
Removed a patch that was merged upstream.
Bumped copyright notice to 2015.

Signed-off-by: Martin Rowe <martin.p.rowe@gmail.com>
2015-04-28 14:19:38 -07:00
Nicolas Thill 0d93cb8973 nut: force rebuild when config changes
Signed-off-by: Nicolas Thill <nico@openwrt.org>
2014-10-25 09:40:56 +02:00
Marty R 0ecfc499ce nut: Updated (c) notice
Signed-off-by: Martin Rowe <martin.p.rowe@gmail.com>
2014-10-19 09:40:02 -07:00
cyanidium d2e5a9896c Remove placeholder maintainer email address 2014-10-15 22:09:29 -07:00
Marty R d8258c35d5 nut: New package for Network UPS Tools
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>
2014-10-15 21:30:25 -07:00