[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



On 17.03.2013 02:53, Clive Standbridge wrote:
>> The reasons seems to be my setup of the system.
>> Debian runs in a VirtualBox environment, headless and w/o X server.
>> I use ssh to connect to the system. (putty)
>> I use X forwarding to run X applications on the system.
>> The variable $DISPLAY gets set to 10.0.2.2:0 after ssh auth.
> 
> I'm pretty sure that the value of DISPLAY means you are using a
> traditional X connection, and not actually using the X forwarding over
> ssh. ssh would set DISPLAY to "localhost:10" or similar.

That is so true!
I have no idea why I have overlooked that fact.

> You will need to remove any setting of DISPLAY from your shell's
> startup files.

Done.

I guess at some point I wanted to be smart and expected that using a
direct connection was quicker than X11Forwarding.

mea culpa

> Make sure your /etc/ssh/sshd_config contains a line:
>   X11Forwarding yes

$ grep X11 /etc/ssh/sshd_config
X11Forwarding yes
X11DisplayOffset 10

> Then connect from Putty without X forwarding. DISPLAY should not be
> set on the Debian machine.

$ echo $DISPLAY|wc --words
0

> Then connect from Putty with X forwarding. DISPLAY should be
> "localhost:10" or similar.

$ echo $DISPLAY
localhost:10.0

> I hope this helps.

It actually does. Even if I keep X forwarding enabled and $DISPLAY set,
su is a lot faster now, good enough for me - problem solved.

Thank you very much for your help! :)

I think the reason why it is faster is that $DISPLAY is localhost with
dbus running. There is no Timeout in strace but only seemingly
successfull calls to the FD of the dbus socket.

Also if I do "/etc/init.d/dbus stop" su is even faster (read instant.)
And interestingly virt-manager still works without dbus. (virt-manager
is the package that also installed dbus)

Sven.


Reply to: