-
Notifications
You must be signed in to change notification settings - Fork 638
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
logging with short hostname instead of FQDN until first HUP #5218
Comments
FYI, I'm the original bug reporter towards Debian and am subscribed to the issue also here, let me know if I can provide any further information or alike. :) Thanks @mbiebl for forwarding this towards upstream. |
I also run into this problem and think I know the reason why it is happening. The function
All this happens during the startup of rsyslogd (in the function
Since at that point the Since I'm not familiar with the source code of rsyslog I cannot tell how difficult would it be to fix the issue. I'd love to have more time to get familiar with the code and attempt to provide a PR but unfortunately I'm currently quite busy with other stuff. Hopefully someone else find this comment useful to fix the issue :) |
@eciii Thanks for the great analysis. I'll see what I can pin down. |
Even if hostname FQDN is configured, rsyslog internal messages generated after rsyslog startup and before the first HUP will not necessarily have FQDN but instead only the shortname of the local host. This commit fixes the situation. Special thanks to github user eciii for doing a great bug analysis and helping us considerably to fix the issue. closes rsyslog#5218
I have refactored some internal processing in #5289, but as of my experience, this now fixes the issue. If anyone wants to try, please feel free to do so. |
Version: 8.2302.0-1
Originally filed as downstream bug https://bugs.debian.org/cgi-bin/bugreport.cgi?bug=1050874
But it's also reproducible with the latest version 8.2308.0-1, notice the usage of
$PreserveFQDN on
Hi,
it looks like the rsyslog version in bookworm is affected by
something related to #4975,
quoting from there:
| After rsyslog start, local hostname is short name only. It changes to FQDN after the first HUP.
I observed this and can reproduce it on several bookworm systems:
Only when sending HUP to rsyslog it behaves as expected:
FTR, the systems have the default /etc/rsyslog.conf:
And /etc/rsyslog.d/postfix.conf as shipped by the postfix package,
plus a custom /etc/rsyslog.d/graylog.conf for central logging are
also in place:
This is especially tricky, as rsyslog's logrotate configuration also
sends the HUP:
So this causes systems to log with short hostname after fresh system
start (and also after every single rsyslog service restart), but
once logrotate kicks in it switches to logging with FQDN / full
hostname instead:
Especially for folks with log monitoring/alerting based on FQDNs
(e.g. with central loggging or logwatch) this might result in
quite some unexpected behavior.
The issue feels similar to what was reported and supposedly fixed
with https://bugs.debian.org/cgi-bin/bugreport.cgi?bug=1022128 and
#5004, though it looks like
to be incomplete yet?
The text was updated successfully, but these errors were encountered: