-
-
Notifications
You must be signed in to change notification settings - Fork 351
Technicalities: Customizing (NUT) config files and scripts delivered by packaging
Supports "diverting" packaged files, so that package updates of those fall into files stored elsewhere while not impacting your actual fine-tuned setup (thanks to m4t
on IRC for the suggestion):
:; dpkg-divert --local --rename --divert /bin/upssched-cmd.diverted --add /bin/upssched-cmd
:; cp -a /bin/upssched-cmd.diverted /bin/upssched-cmd
### Customize your newly independent /bin/upssched-cmd
Generally this trick can be used to move a packaged binary somewhere else and replace it with a wrapper script that sets environment variables and/or command line flags and exec
's the real thing. (Hacking a custom LD_PRELOAD
or debugging comes to mind.)
Normally for most of the NUT related scripting you are encouraged to customize the configuration files and point the SHUTDOWNCMD
, CMDSCRIPT
etc. to the custom filename which just does not conflict with packaging.
You don't have to (or rather even should not) rewrite packaged *.service
and related files directly.
On one hand, SystemD supports a hierarchy of unit definitions (rising in priority from packaged {/usr,}/lib/systemd/system/
to site-local /etc/systemd/system/
to run-time /run/systemd/system/
which technically allows you to copy packaged files and customize them locally). On another, it also allows drop-in files which overlay a standard service or instance definition to tune it locally - by creating a directory like .../systemd/system/FULLUNITNAME.d/
and files named something.conf
in it with the unit definition nuances you want to tune.
You can note that NUT's own nut-driver-enumerator
(NDE) makes extensive use of this feature to maintain dependencies for nut-driver@...
instances depending on device media type.
Welcome to the Network UPS Tools (NUT) project Wiki, and feel free to contribute tricks and insights.
While there are several good entries in the menu, ones referenced most frequently in issue discussions include:
- Building NUT for in-place upgrades or non-disruptive tests and Using NIT (NUT Integration Test suite) sandbox
- Technicalities: Customizing (NUT) config files and scripts delivered by packaging
- Links to distribution packaging recipes and repository sections
- Troubleshooting
upsdrvctl
drivers not starting ("insufficient permissions on everything" or "Can't claim USB device [VVVV:PPPP]@0/0: Entity not found") possibly due to nut-driver-enumerator (NDE) services having been there before you with NUT 2.8.x - Changing NUT daemon debug verbosity
- Building NUT integration for Home Assistant
- Running NUT in an LXC container
- Troubleshooting eventual disconnections (Data stale) and CyberPower Systems (CPS) know-how
- NUT for Windows
- NUT HCL and DDL
- Code contributions, PRs, PGP and DCO
- NUT CI farm
Also keep in mind the documentation links from NUT website and the FAQ in particular.