Re: "su" - timeout for dbus/system_bus_socket if $DISPLAY set but unreachable
On 16.03.2013 05:45, Bob Proulx wrote:
>> The problem is that "su" takes 25 seconds before it succeeds.
>
> That sounds like a DNS timeout. If you do a dns lookup of your
> systems hostname does it respond?
# nslookup localhost
Name: localhost
Address: 127.0.0.1
# nslookup 127.0.0.1
1.0.0.127.in-addr.arpa name = localhost.
# nslookup baldur
** server can't find baldur: NXDOMAIN
# nslookup baldur.asgard
** server can't find baldur.asgard: NXDOMAIN
# ping baldur
PING baldur.asgard (127.0.1.1) 56(84) bytes of data.
> Look in /etc/hosts and look for (at least) these lines:
# grep 127. /etc/hosts
127.0.0.1 localhost
127.0.1.1 baldur.asgard baldur
> Because PAM often logs the hostname to the system log and does
> other such DNS lookups.
Can I disable reverse DNS lookup?
>> Using strace I think I identified the problem:
>>> connect(4, {sa_family=AF_FILE,
>> path="/var/run/dbus/system_bus_socket"}, 33) = 0
>>> ... poll([{fd=4, events=POLLIN}], 1, 25000) = 0 (Timeout)
>>> <25.028989>
>>
>> I can skip the timeout if I do either of these two things:
>> Solution 1) run X server on 10.0.2.2 (Xming) Solution 2) unset
>> $DISPLAY
>
> If you dns lookup 10.0.2.2 does it resolve? Quickly or after a
> longer timeout?
# nslookup 10.0.2.2
** server can't find 2.2.0.10.in-addr.arpa.: NXDOMAIN
# ping 10.0.2.2
PING 10.0.2.2 (10.0.2.2) 56(84) bytes of data.
# ping wotan
ping: unknown host wotan
C's getnameinfo() returns: "Name or service not known"
But as it is a private IP, why should there be a DNS? Wouldnt everyone
have the same problem if they dont set up their own BIND or hosts file?
I have added the remote hostname to /etc:
# grep wotan /etc/hosts
10.0.2.2 wotan.asgard wotan
Of course I only get the following changes:
# ping wotan
PING wotan.asgard (10.0.2.2) 56(84) bytes of data.
C's getnameinfo() returns: wotan.asgard
Though no change in the behaviour of "su", still a 25 seconds timeout
before it succeeds.
In the output of strace I can see that /something/ happens with
libnss, so DNS lookup. But unfortunately I am unable to tell what it
is. But there seems not to be any timeout related to DNS.
Any use of posting a full strace log? I dont think so.
> Hopefully someone else will have a better suggestion.
Thank you anyways. Getting any response is always good, instead of
being ignored completely :)
Sven.
Reply to: