<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN">
<html>
<head>
  <meta content="text/html; charset=UTF-8" http-equiv="Content-Type">
</head>
<body text="#000000" bgcolor="#ffffff">
On 05/26/2009 05:53 PM, Adam Jackson wrote:
<blockquote
 cite="mid:1243353190.26652.57.camel@atropine.boston.devel.redhat.com"
 type="cite">
  <pre wrap="">On Sat, 2009-05-23 at 13:53 +0200, Mildred Ki'Lya wrote:

  </pre>
  <blockquote type="cite">
    <pre wrap="">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?
    </pre>
  </blockquote>
  <pre wrap=""><!---->
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:

---
#!/usr/bin/python

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]
                client_sockets.append(inode)

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

- ajax
  </pre>
</blockquote>
<br>
Thanks a lot, I used a similar shell script:<br>
<br>
<pre>#!/bin/sh

inodes="$(netstat -an --unix | grep X11-unix | sed 's/  */ /g' | sed 's/\[ ACC \]/[ ]/' | cut -d' ' -f7)"

lsof +c0 | head -n 1  

while read line; do
        inode="$(sed 's/  */ /g' <<<"$line" | cut -d' ' -f8)"
        #echo $inode
        if grep "^$inode$" <<< "$inodes" >/dev/null; then
                echo "$line"
        fi
done <<<"$(lsof +c0 -w | tail -n +2)"</pre>
<br>
I removed the -U option of lsof, with it I couldn't find anything<br>
I found a lot of instances of syndaemon, I think it's the cause.<br>
<br>
Mildred<br>
<pre class="moz-signature" cols="72">-- 
Mildred Ki'Lya
╭───────── mildred593@online.fr ──────────
│ Jabber, GoogleTalk: <a class="moz-txt-link-rfc2396E" href="mailto:mildred@jabber.fr"><mildred@jabber.fr></a>
│ Website: <a class="moz-txt-link-rfc2396E" href="http://ki.lya.online.fr"><http://ki.lya.online.fr></a>           GPG ID: 9A7D 2E2B
│ Fingerprint: 197C A7E6 645B 4299 6D37 684B 6F9D A8D6 9A7D 2E2B
</pre>
</body>
</html>