-
-
Notifications
You must be signed in to change notification settings - Fork 351
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Support LIBUSB_DEBUG=NUM
setting in ups.conf
#2649
Conversation
… and upsd Signed-off-by: Jim Klimov <jimklimov+nut@gmail.com>
….conf Signed-off-by: Jim Klimov <jimklimov+nut@gmail.com>
checked , working fine for nut plugin in Unraid.
|
Good question. The current implementation sets the environment variable for this process while reading configuration from Maybe it can also change the value during a reload signal/command processing (if it changed in I also see now I've only tested it with a dump mode, which does not |
Per https://stackoverflow.com/a/17929641/4715872 discussion,
So there should be no need for a separate |
Using nut plugin for Unraid, i added |
asl ofound some libusb debug present after line i wrote above... |
So to be clear, you've added the setting and it had effect all the lifetime of the driver (regular update loop and all)? Then it works as it should :) (run-time modification improvements speculated above being separate goals) |
No not at all lifetime , when debugmin = default also soemtime when =6 : only befor but today i found it was also debug + libusb debug but then is gone from list . i can send debug file if you interested |
Maybe I got it: when we fork, stderr is normally detached (this can be maybe tweaked when dev/testing), and usbdebugx posts to syslog. But libusb's own debug probably does not, or needs more settings if it can? I can suggest avoiding forking, e.g. |
Generally when you fork, the stderr fd is inherited. libusb logs to stderr by default, unless built with --enable-system-log. |
Added this feature to https://github.com/networkupstools/nut/wiki/Changing-NUT-daemon-debug-verbosity |
Note that the libusb API link on the that wiki page is broken. |
Thanks, fixed! Wringing it through GitHub renderer took a while (double underscores treated as HTML |
Addresses part of #2616
A quick hack for that issue, to
setenv()
the envvar during configuration parsing, so hopefully the library would see it:A cleaner solution would be to call
libusb_set_debug()
specifically, when initializing a context for device communications, but needs some more careful coding :) so can be a follow-up sometime later.FYI : CC @masterwishx @tormodvolden
UPDATE: Checked that you can change it at run-time by setting a value in driver configuration, e.g.
LIBUSB_DEBUG=4
for max verbosity, and reloading the driver. Note that unlikedebug_min
setting, commenting away the line does not work to tone it down -- you would have to set it to0
explicitly and reload again (or let NDE take care of it on some platforms).