X11: Maximum number of clients reached

Adam Jackson ajax at redhat.com
Tue May 26 15:53:10 UTC 2009

On Sat, 2009-05-23 at 13:53 +0200, Mildred Ki'Lya wrote:

> So, it happened again. There are 234 opened sockets, and the last file
> descriptor seems to be 255u, so perhaps there is a limit there. Any
> ideas on how to find the program responsible for that?

This is a bit awkward since there's no obvious way to get the inode of
the peer socket.  The best you can do is hope that it was created
immediately before the corresponding fd in the X server.  So, something
like this:


from subprocess import Popen, PIPE

client_sockets = []
match = 0

ns = Popen(["netstat", "-an", "--unix"], stdout=PIPE)
output = ns.communicate()[0]
for line in output.split('\n'):
	if line.find("X11-unix") != -1:
		match = 1
	elif match:
		match = 0
		inode = line.split()[6]

lsof = Popen(["lsof", "-U", "+c0", "-w"], stdout=PIPE)
output = lsof.communicate()[0]
for line in output.split('\n'):
		inode = line.split()[7]
		if inode in client_sockets:
			print line

- ajax
-------------- next part --------------
A non-text attachment was scrubbed...
Name: not available
Type: application/pgp-signature
Size: 197 bytes
Desc: This is a digitally signed message part
Url : http://lists.fedoraproject.org/pipermail/test/attachments/20090526/344ec0a0/attachment.bin 

More information about the test mailing list