-
Notifications
You must be signed in to change notification settings - Fork 640
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
tests/empty-hostname.sh fails: expected hostname "localhost" not found in logs #1268
Comments
I have added some doc to the test. The assumptions on the hostname are valid, the probable root cause is that the preload library is not loaded for some reason. This is also clear from the hostname being returned. |
I added some printf debug statements to runtime/net.c Looking at getLocalHostname(), we do get an empty hostname from hnbuf is set to localhost (as expected). At https://github.com/rsyslog/rsyslog/blob/master/runtime/net.c#L1164
fqdn is set to foo and this is what's returned from getLocalHostname. |
On a related note: if gethostname() returns a non-emtpy string, why do we not use that name but set it to localhost at UPDATE: Forget what I said here. The != 0 check is testing the return code and not the string length. So all fine |
…name If gethostname() returned "", we used "localhost" as mock-up hostname. However, this caused problems depending on how the local system name was actually configured. We have changed the mock.up hostname to "localhost.empty-hostname" now to clearly indicate the problem. Not only as a side effect, this also fixes obtaining a different hostname. closes rsyslog#1268
Thanks, I was obviously too focussed on the gethostname() call. Using |
Note: I have also reconfigured the debian buildbot slave to showcase that problem. So hostname-related issues are hopefully sooner detected in the future. |
…name If gethostname() returned "", we used "localhost" as mock-up hostname. However, this caused problems depending on how the local system name was actually configured. We have changed the mock-up hostname to "localhost-empty-hostname" now to clearly indicate the problem. Also, we make sure that we do no accidently try to resolve the mock-up hostname. closes rsyslog#1268
This thread has been automatically locked since there has not been any recent activity after it was closed. Please open a new issue for related bugs. |
Bug-Debian: https://bugs.debian.org/cgi-bin/bugreport.cgi?bug=844914
I'm getting a test-suite failure
To reproduce the issue setup a /etc/hosts like this
If one uses
the test succeeds. So I asume it makes certain (incorrect) assumptions about how /etc/hosts is setup
The text was updated successfully, but these errors were encountered: