Skip to content

Conversation

@tofurky
Copy link
Contributor

@tofurky tofurky commented Sep 15, 2022

This can clutter up logs on things that call 'upsc', such as Munin plugins. Switch it to upsdebugx() so it's not always output to stderr.

This can clutter up logs on things that call 'upsc', such as Munin
plugins. Switch it to upsdebugx() so it's not always output to stderr.
@tofurky
Copy link
Contributor Author

tofurky commented Sep 15, 2022

unsure if both the Init SSL messages should go to upsdebugx (or neither, really).

@jimklimov jimklimov added enhancement SSL/NSS Issues and PRs about SSL, TLS and other crypto-related matters labels Sep 16, 2022
@jimklimov
Copy link
Member

One alternative is to use debug level 0 so it always pops up on stderr like now, but does not hit the syslog.

@jimklimov
Copy link
Member

Asked community on mailing lists - if insecurity reminders were deemed useful.

@jimklimov
Copy link
Member

Question: which logs does it clutter - syslog (thanks to upslogx used) or some unhandled stderr in munin?

@tofurky
Copy link
Contributor Author

tofurky commented Sep 16, 2022

munin writes unhandled stderr to syslog (*/5):

Sep 16 09:45:11 aquos munin-node[2781871]: 2022/09/16-09:45:11 [2781871] Error output from nut_misc:
Sep 16 09:45:11 aquos munin-node[2781871]: 2022/09/16-09:45:11 [2781871] #011Init SSL without certificate database
Sep 16 09:45:12 aquos munin-node[2781871]: 2022/09/16-09:45:12 [2781871] Error output from nut_volts:
Sep 16 09:45:12 aquos munin-node[2781871]: 2022/09/16-09:45:12 [2781871] #011Init SSL without certificate database

i suppose the munin plugin could be modified to redirect stderr to /dev/null, but that'd also remove useful errors. my reasoning was that adding a grep -v pipe would add extra overhead. i think it'd also require redirecting stderr to stdout which would mess with the parser if other errors were emitted.

thanks for putting a feeler out.

edit: it does not write to syslog by default. i think it writes to /var/log/munin/munin-node.log.

@jimklimov
Copy link
Member

FWIW, a link to stirred-up discussion : https://alioth-lists.debian.net/pipermail/nut-upsdev/2022-September/007761.html

@jimklimov
Copy link
Member

So far it seems the proposition is reasonable, but this quiescing should be non-default. Might be activated by an envvar and/or command-line option. since upsc (or for that matter other clients -- consumers of this library -- like upsrw and upscmd) do not have any config files.

@tofurky
Copy link
Contributor Author

tofurky commented Sep 20, 2022

i think an env variable might work. adding a new cli flag wouldn't really be usable if it gave a syntax error when it's unsupported.

i did look pretty closely at how NSS is initialized, and the conclusion i came to is that simply changing the verbosity of the message was the most straightforward thing to do.

@tofurky tofurky closed this Sep 20, 2022
jimklimov added a commit to jimklimov/nut that referenced this pull request Sep 25, 2022
@jimklimov
Copy link
Member

Thanks for raising the concern about "a syntax error when it's unsupported", so I posted a PR for an envvar-based solution. Can you check if that looks good for your purposes?

@tofurky
Copy link
Contributor Author

tofurky commented Sep 25, 2022

yep, it should work. left a note there as well. thanks!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

enhancement SSL/NSS Issues and PRs about SSL, TLS and other crypto-related matters

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants