Long time delay from ck-get-x11-server-pid with remote DISPLAY
Affects | Status | Importance | Assigned to | Milestone | |
---|---|---|---|---|---|
consolekit (Ubuntu) |
Confirmed
|
Undecided
|
Unassigned |
Bug Description
Binary package hint: consolekit
Dear consolekit maintainers,
When DISPLAY is set to a remote display, the remote display server is down/unreachable and you su from user to root (or someother user), this can take ~30 seconds+ to complete.
ps reveals ck-get-
Since it is impossible to get the process ID of the other end of a TCP connection (manpages say Xlib uses TCP connections when DISPLAY has a hostname: part), I have a patch below which skips getting the PID for remote DISPLAYs. This fixes this problem for me (su times are now unnoticable), and I submit the patch in case you are interested. I have not done any extensive testing with it however, and don't know what effects it might have on its callers, return code wise. This is a pretty low priority problem.
Supporting info:
DISPLAY=
root@localhost:~# time su -c exit
real 0m25.355s
user 0m0.064s
sys 0m0.212s
25469 pts/3 S+ 0:00 su -c exit
25470 ? S 0:00 /usr/lib/
25471 ? S 0:00 /usr/lib/
Calling /usr/lib/
** (process:17961): WARNING **: cannot open display: 192.168.254.1:0.0
References:
If the DISPLAY variable has a hostname component, e.g. "remotehost:0.0", XOpenDisplay will use a TCP connection to it, and the fd it returns later will be a TCP socket.
(http://
It is only possible to get the peer socket's PID for UNIX domain sockets.
(E.g. On linux, SO_PEERCRED is only usable for UNIX domain sockets (i.e. PF_UNIX) )( http://
Changed in consolekit (Ubuntu): | |
status: | New → Confirmed |