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

fuser and sockets?



Hi,

fuser seems to be misbehaving for me.  It does not return the PID for
UNIX sockets.  I wrote the following little script to illustrate my
problem:


------------------------------
#!/usr/bin/perl -Tw
use strict;
use Socket;
use Carp;

my $server;
socket($server,PF_UNIX,SOCK_STREAM,0)        || die "socket: $!";
bind  ($server, sockaddr_un('sockfile.ctl'))       || die "bind: $!";
listen($server,SOMAXCONN)                    || die "listen: $!";
while (1) {
  my $client;
  accept($client, $server);
  my $data = <$server>;
  print "$data";
}
--------------------------------

After starting it, I run the following:

------------------------
casey@host:~$ fuser sockfile.ctl
casey@host:~$ lsof -t sockfile.ctl
6293
------------------------

fuser doesn't return anything, and lsof returns the correct
PID--although both take a long time (~30s) to return.  It seems that not
too long ago, fuser worked, and the return time was quick.

This seems to be the case on both my etch and sid boxes.  Any ideas?

Casey




Reply to: