Support optional ALLOW_NO_DEVICE=true in upsd#766
Support optional ALLOW_NO_DEVICE=true in upsd#766jimklimov merged 16 commits intonetworkupstools:masterfrom
Conversation
Signed-off-by: Arnaud Quette <ArnaudQuette@Eaton.com>
…o allow starting with 0 ups.conf sections
|
In testing, behaves as expected:
|
|
For a holistic solution, updated with 42ity#109 to support also setting this configuration value "properly" via upsd.conf. The code still supports an envvar as a higher-priority option, this can be used in production (e.g. via nut.conf and init-scripts or service units that honor it) or in development to run your built |
…m nut.conf) can override the setting in upsd.conf
|
a side comment, vaguely related, with Debian and systemd, to shed a bit more light on the topic: in other words, either NUT is not configured, and all systemd units are disabled (or better masked) ; otherwise NUT is configured (fully or just with ALLOW_NO_DEVICE) and at least upsd unit is startable. Otheriwse, systemd units will fail to start if ALLOW_NO_DEVICE is not active and set to true by default. |
|
@aquette : would it make sense to suicide? :) Amend all our units to read Alternately, that errata is about init.d, and we are providing the systemd unit files (although wrapping method scripts with same semantic as the problem highlighted in that doc). |
|
I guess I'll leave the alignment with systemd recommendation as a separate issue that anyone interested can tackle sometime... |
Allow curious admins to start their nut server deliberately without any device configuration sections yet defined. A subsequent
reloadcan have this daemon learn about changed configurations, but from the get-go first boot it can serve the NUT protocol with whatever it knows (supposedly, a clean "nothing here!" statement).Also includes a fix for reload from 42ity#64
UPDATE: After some evolution of this PR and its counterpart in 42ity, the setting was renamed to a more agreeable spelling, and it is possible to set it with
upsd.conf(probably the recommended manner now) or with an environment variable passed toupsd, at higher priority than hardcoded or configured value (allowing to tweak it for custom runs, dev-tests, etc. - and for the originally proposed setting vianut.conffile which is sourced by systemd and SMF units and most init-scripts).