-
Notifications
You must be signed in to change notification settings - Fork 58
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
enable systemctl reload diod + minor logging improvements #132
Conversation
c7b5921
to
12c9f91
Compare
Derp. Botched a test there but it's fixed now. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
LGTM!
@@ -26,15 +26,27 @@ | |||
|
|||
#include "diod_log.h" | |||
|
|||
static char *prog = NULL; | |||
|
|||
static char log_prefix[32] = { 0 }; |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
commit message nit: "some TAP unit test" -> "some TAP unit tests"
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Thanks! Fixed and I'll set MWP.
Problem: some TAP unit tests emit debug output prefixed with "#: ", which is legal TAP but looks funny. Change diod_log_init() to not append ": " to the log prefix if it already ends in a space, and change the test server to do that. Also skip the log prefix if diod_log_init() is called with a NULL argument, anticipating the next commit.
Problem: the "diod: " log prefix is not helpful because server logging is rarely mixed with output from other programs. Or if it is, it's been processed through the systemd journal or syslog which also adds its own prefix. Initialize server logging with no prefix.
Problem: it may be useful, especially when debugging, to know what ports and interfaces diod is listening on. Log this when diod starts up. Update tests/misc/t15 for this change and clean up its Makefile.am.
Problem: diod supports runtime configuration reloading but the systemd unit file doesn't. Arrange to send SIGHUP to diod when an admin runs systemctl reload diod.
The systemd unit file is modified so that
systemctl reload diod
can be used to modify the exports config without completely restarting.In addition, this tweaks logging slightly