[Date Prev][Date Next] [Thread Prev][Thread Next] [Date Index] [Thread Index]

Re: "su" - timeout for dbus/system_bus_socket if $DISPLAY set but unreachable



Sven Uhlig wrote:
> this is my first message to this list.

Welcome.

> I noticed a little problem on my system after I installed the package
> "virt-manager" and its dependencies on my system. One of the
> dependencies is "dbus".

Ugh.  "dbus".  I feel your pain.  Too many applications have egregious
dependencies upon dbus.  (For example I disagree that emacs needs dbus
to operate.  But there it is.)

> The problem is that "su" takes 25 seconds before it succeeds.

That sounds like a DNS timeout.  Although you have reported that it is
only when used with $DISPLAY set I still would want to double check
that the system's hostname is set up correctly.  If you do a dns
lookup of your systems hostname does it respond?

Look in /etc/hosts and look for (at least) these lines:

  127.0.0.1 localhost
  127.0.1.1 foo.example.com foo

Replace foo.example.com with your actual hostname.  That should be
there.  If that is not there then it is likely the source of dns
lookup timeout problems.  Because PAM often logs the hostname to the
system log and does other such DNS lookups.

> 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>
>
> The reasons seems to be my setup of the system.
> Debian runs in a VirtualBox environment, headless and w/o X server.

That sounds normal to me.  I would even go so far as to say
mainstream.  I would not call headless without X server unusual at
all.  And that it is VirtualBox shouldn't make any difference at all.
Most of us use ssh to connect.  And the X forwarding or not as we desire.
All of that is very normal.

> 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?

Hopefully someone else will have a better suggestion.

Bob

Attachment: signature.asc
Description: Digital signature


Reply to: