nut icon indicating copy to clipboard operation
nut copied to clipboard

Ensure that all drivers print version information before they go into the background

Open clepple opened this issue 9 years ago • 3 comments

In the "Starting the driver(s)" section in the user manual, the example says Detected EATON - Ellipse MAX 1100 [...].

Not all drivers do this. For instance, usbhid-ups uses upsdebugx(1, ...) which won't print to the console unless a user has debugging turned on.

After fixing the drivers, update the documentation in case the format has changed.

clepple avatar Sep 15 '16 00:09 clepple

At least currently usbhid-ups does report the following details:

# ./drivers/usbhid-ups -a eco650
Network UPS Tools - Generic HID driver 0.49 (2.8.0-Windows-316-g0a5cfdfe6)
USB communication driver (libusb 1.0) 0.43
Using subdriver: MGE HID 1.46

But indeed gotta check that everybody does.

Also, following the example in description, it did not print the specific device information

jimklimov avatar Jan 06 '23 14:01 jimklimov

I think it's a bug for programs to print version if not asked to (via some -v -or -D). Most daemons do not do this.

gdt avatar Jan 09 '23 16:01 gdt

See also PR #2386 which should ensure that specifically NUT version is printed early.

For drivers/main.c it also revisits the upsdrv_banner() for common "NUT version + driver name" printout (flush stdout to make sure it is posted - notably might remain buffered and lost if the program segfaults etc).

jimklimov avatar Apr 10 '24 07:04 jimklimov

With the PRs listed above, driver banner is always printed unless disabled explicitly, early before parsing the bulk of command-line arguments (or in help/verbose handling, if it was disabled). Stated scope goals seem achieved.

jimklimov avatar Sep 12 '24 08:09 jimklimov