Skip to content
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

Merged
merged 4 commits into from
Jan 20, 2025

Conversation

garlick
Copy link
Member

@garlick garlick commented Jan 19, 2025

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

  • TAP tests log with "# " prefix
  • diod server logs without a program prefix
  • listen addresses are now logged on startup

@garlick garlick force-pushed the logging branch 2 times, most recently from c7b5921 to 12c9f91 Compare January 20, 2025 00:06
@garlick
Copy link
Member Author

garlick commented Jan 20, 2025

Derp. Botched a test there but it's fixed now.

Copy link
Member

@grondo grondo left a 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 };
Copy link
Member

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"

Copy link
Member Author

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.
@mergify mergify bot merged commit fb78bf2 into chaos:master Jan 20, 2025
6 checks passed
@garlick garlick deleted the logging branch January 20, 2025 17:02
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants