Questions tagged [lsof]

Lsof is a tool to list opened files by processes

Lsof is a tool to list on its standard output file information about files opened by processes.

104 questions
2
votes
1 answer

lsof shows tmp growing file marked as deleted

I have a cron that generated a lot (15GB) of PHP warnings and was writing them in a log file. I killed the process and as a temporary measure I stopped redirecting stderr to stdout so I don't fill up my storage. After the change, I continued getting…
rwms
  • 155
  • 1
  • 2
  • 7
2
votes
4 answers

"Logical volume in use" -- cannot remove logical volume

On a Xen 4.8 hypervisor, running on Debian Stretch, I am trying to remove the logical volume of a domU that is no longer used. I stopped the domU and successfully removed the logical volume for the swap file. However, when trying to remove the…
Jonathan Maron
  • 121
  • 1
  • 1
  • 5
2
votes
1 answer

Linux : Count Open Files for Process

How can I check how many open files are currently used? Checking on PM2 is just an example: I found the PID: ps aux | grep pm2 | awk '{ print $2 }' Checked that there is a limit of 65536 openfiles: # cat /proc/16305/limits | grep 'Max open…
crashoverbike
  • 123
  • 1
  • 4
2
votes
1 answer

What does the lsof -c flag filter out?

lsof will show a table with the first column being the command name and each row, an open file. So to only show rows from a specific command, say "java", it would make sense to try lsof | grep ^java. This works, but I understand lsof has it's own…
Julian
  • 121
  • 1
  • 4
2
votes
1 answer

nrpe user cant properly execute script remotely using lsof, netstat works

I created a simple script for nagios to check a port on a remote server. Originally, I tried to use lsof. #!/bin/bash RESULT=$(lsof -i :8080 | grep LISTEN) if [ -n "$RESULT" ] then echo "$RESULT" exit 0 else echo "Check application port…
user53029
  • 629
  • 3
  • 14
  • 36
2
votes
1 answer

lsof returns "can't read vnode" error

On a Solaris 10 box, I am getting errors from lsof: can't read vnode at 0x7d900000000 can't read vnode at 0x7b But I have the same lsof binary in another similar Solaris 10 box where it doesn't give the same error. On that other box, lsof…
user55570
  • 458
  • 6
  • 18
2
votes
1 answer

Is it possible to deterministically trace how port 80 is forwarded and where the configuration is on a given system?

Is there a way to determine or trace how a port forwarding configuration is set up on a system running Ubuntu 14.04 LTS, on which there is a NodeJS service running and somehow accepting connections via port 80, although the service itself is running…
2
votes
1 answer

Safe to kill a process called *:etlservicemgr (LISTEN)?

I am trying to serve locally to port 9001 but I get an listen EADDRINUSE error. When I look at the port with lsof -i :9001 it shows the following COMMAND PID USER FD TYPE DEVICE SIZE/OFF NODE NAME node 3369 Name 12u IPv4…
iluvatar14
  • 21
  • 1
  • 2
2
votes
1 answer

Process has more open sockets than should be allowed by prlimit

Running debian jessie. The following is done as root to avoid any permissions issues. First I find the pid of my program, then I check its open file limit to verify that it is set at 1024. But when I count the number of open files, I find 1851. $…
nullUser
  • 236
  • 1
  • 7
2
votes
1 answer

Regular and repetitive sudo alerts from several Linux hosts

I've got several hosts running CentOS 5.11 on the LAN. Lately we've been getting fairly regular sudo alerts (via email) from attempted sudo commands by non-authorized users. Been Googling in case the attempted commands are known hacks, or known…
Dan
  • 61
  • 2
2
votes
1 answer

Incoming FTP transfer not showing in lsof when using specific FTP client

I've got a script that continuously monitors an FTP dropbox directory and processes new files when they come in. The script runs lsof on each file before it tries to process it to determine if the file is still being transferred (some files are…
bcst
  • 41
  • 1
  • 1
  • 6
2
votes
2 answers

find owner and spawn process of ssh connection

There is this one server I manage which regularly (few times a minute) tries a connection to another machine on tcp port 22. (ssh) My question: how can I find the process that spawned this connection? What did I check already: tcpdump capture on…
lievendp
  • 91
  • 1
  • 1
  • 10
2
votes
0 answers

Apache web server maxing out due to processes stuck at D status

I have a Apache 2.2.3 web server running on a 8 core VM with 8G Ram. During a load test, the web server stopped responding and load average went up to 1000. When I run Top command, I see a large number of httpd processes are stuck at "D" status. I…
Allen Qin
  • 121
  • 3
2
votes
2 answers

how can i see if an open filehandle is writeable or not on a linux system?

I can see with lsof that a process has an open filehandle for a particular file, but is there a way that I can see what kind of filehandle (ex: r, rw) it is?
kclair
  • 121
  • 2
2
votes
1 answer

txt file descriptor in lsof

In my experience, files that have the file descriptor of txt in lsof output are the executable file itself and shared objects. The lsof man page says that it means "program text (code and data)". While debugging a problem, I found a large number of…
wfaulk
  • 6,878
  • 7
  • 46
  • 75