lsof

How to debug a connection failure between Jboss and eclipse debugger

北慕城南 提交于 2019-12-02 18:35:09
问题 I have setup eclipse to attach to a local JVM. But when I try to do the same for a machine over the network I get "connection timed out exception". How do I go about debugging this issue? I tried: lsof -i :8787 on the remote machine, and it appears that a java process is in fact listening on that port. What else could be wrong and how to go about finding it. Please help. Thank you. Note: My JAVA_OPT looks like this on the remote machine. JAVA_OPTS=”-Xdebug -Xnoagent -Xrunjdwp:transport=dt

centos7.4 lsof用法

和自甴很熟 提交于 2019-12-02 14:40:50
lsof是指“列出打开文件(lists openfiles)”。而有一点,在Unix中一切(包括网络套接口)都是文件。 语法格式如下: lsof [ -?abChlnNOPRtUvVX ] [ -A A ] [ -c c ] [ +c c ] [ +|-d d ] [ +|-D D ] [ +|-e s ] [ +|-f [cfgGn] ] [ -F [f] ] [ -g [s] ] [ -i [i] ] [ -k k ] [ -K k ] [ +|-L [l] ] [ +|-m m ] [ +|-M ] [ -o [o] ] [ -p s ] [ +|-r [t[m<fmt>]] ] [ -s [p:s] ] [ -S [t] ] [ -T [t] ] [ -u s ] [ +|-w ] [ -x [fl] ] [ -z [z] ] [ -Z [Z] ] [ -- ] [names] 这个命令的参数非常多,接下来介绍几个常用的参数配置方法: 1.-i参数 获取符合条件的网络连接 1)查询IPV4或者IPV6的连接 获取Ipv4的连接:lsof -i 4 2)查询指定协议的网络连接:协议有两种tcp,udp 如查询tcp连接:lsof -i tcp 3)查询端口使用情况,语法是lsof -i :端口号 如查询5000端口的使用情况:lsof -i :5000 来源: https:/

Is it possible to control which libraries apache uses?

天涯浪子 提交于 2019-12-02 13:34:49
问题 Okay, so I had an earlier problem with PIL that is still unresolved. Someone else had this problem and had success by removing the old JPEG library. I can't really do that on my machine, however, as it's RHEL and so many things are dependent on libjpeg and libjpeg-devel (when I tried yum remove libjpeg just to see, there were a total of 252 packages that would have been removed!) I have jpeg-8 installed in /usr/local/lib. It's correctly being used by python, but not by apache. Here's a list

14-1 进程管理与任务计划

无人久伴 提交于 2019-12-02 11:38:46
进程管理与任务计划 系统管理工具 进程的分类: CPU-Bound:CPU密集型,非交互 IO-Bound:IO密集型,交互 Linux系统状态的查看及管理工具:pstree, ps, pidof, pgrep, top, htop, glance, pmap, vmstat, dstat, kill, pkill, job, bg, fg, nohup pstree命令: pstree display a tree of processes ps: process state ps report a snapshot of the current processes Linux系统各进程的相关信息均保存在/proc/PID目录下的各文件中 查看进程ps ps [OPTION]... 支持三种选项: UNIX选项 如-A -e BSD选项 如a GNU选项 如--help 选项:默认显示当前终端中的进程 a 选项包括所有终端中的进程 x 选项包括不链接终端的进程 u 选项显示进程所有者的信息 f 选项显示进程树,相当于 --forest k|--sort 属性 对属性排序,属性前加- 表示倒序 o 属性… 选项显示定制的信息 pid、cmd、%cpu、%mem L 显示支持的属性列表 ps常见选项: -C cmdlist 指定命令,多个命令用,分隔 -L 显示线程 -e

Is it possible to control which libraries apache uses?

久未见 提交于 2019-12-02 04:44:06
Okay, so I had an earlier problem with PIL that is still unresolved. Someone else had this problem and had success by removing the old JPEG library . I can't really do that on my machine, however, as it's RHEL and so many things are dependent on libjpeg and libjpeg-devel (when I tried yum remove libjpeg just to see, there were a total of 252 packages that would have been removed!) I have jpeg-8 installed in /usr/local/lib. It's correctly being used by python, but not by apache. Here's a list from lsof: COMMAND PID USER FD TYPE DEVICE SIZE NODE NAME httpd xxxxx root mem REG 253,3 xxxxx0 xxxxx34

lsof命令

别等时光非礼了梦想. 提交于 2019-12-01 23:24:22
[root@localhost ~]# rpm -qa|grep lsof lsof-4.82-4.el6.x86_64 在终端下输入lsof即可显示系统打开的文件,因为 lsof 需要访问核心内存和各种文件,所以必须以 root 用户的身份运行它才能够充分地发挥其功能。每行显示一个打开的文件,若不指定条件默认将显示所有进程打开的所有文件。 lsof - list open files Lsof revision 4.82 lists on its standard output file information about files opened by processes for the following UNIX dialects: AIX 5.3 Apple Darwin 9 (Mac OS X 10.5) FreeBSD 4.9 for x86-based systems FreeBSD 7.[012] and 8.0 for AMD64-based systems Linux 2.1.72 and above for x86-based systems Solaris 9 and 10 An open file may be a regular file, a directory, a block special file, a character special

Non zero exit code for lsof

旧城冷巷雨未停 提交于 2019-12-01 18:52:27
I am using following lsof command: lsof -iTCP -a -sTCP:^LISTEN -a -p <pid> If there is some output this command returns an exit code of 0 but if there is no output the exit code is 1 . echo $? Can anyone explain why is this happening? Is there a way to avoid it? This is the expected behaviour: you just get 0 if something was found. From man lsof : DIAGNOSTICS Errors are identified with messages on the standard error file. Lsof returns a one (1) if any error was detected, including the failure to locate command names, file names, Internet addresses or files, login names, NFS files, PIDs, PGIDs,

查看linux默认能最多开启多少个文件数量

北战南征 提交于 2019-12-01 16:04:55
ulimit –a ulimit –n #vi /erc/security/limits.conf ( 修改文件开启的限制 ) # #<domain> <type> <item> <value> # #* soft core 0 #* hard rss 10000 #@student hard nproc 20 #@faculty soft nproc 20 #@faculty hard nproc 50 #ftp hard nproc 0 #@student - maxlogins 4 * soft noproc 10000 (可选) * hard noproc 10000 (可选) * soft nofile 65535 * hard nofile 65535 ( 添加的两行 ) # End of file :wq 保存退出 说明 : * 代表针对所有用户 noproc 是代表最大进程数 nofile 是代表最大文件打开数 注意: 这个当中的硬限制是实际的限制,而软限制是 warnning 限制,只会做出 warning ; 执行下面的两条命令 ulimit –Hn 65535 ulimit –Sn 65535 最后重启系统才能生效 reboot 在查看 ulimit –n #ulimit –n 65535 已打开文件数限制,已调至最大。 参考: CentOS 6

Linux命令总结--lsof命令

被刻印的时光 ゝ 提交于 2019-12-01 10:16:51
简介 lsof(list open files)是一个列出当前系统打开文件的工具。在linux环境下,任何事物都以文件的形式存在,通过文件不仅仅可以访问常规数据,还可以访问网络连接和硬件。所以如传输控制协议 (TCP) 和用户数据报协议 (UDP) 套接字等,系统在后台都为该应用程序分配了一个文件描述符,无论这个文件的本质如何,该文件描述符为应用程序与基础操作系统之间的交互提供了通用接口。因为应用程序打开文件的描述符列表提供了大量关于这个应用程序本身的信息,因此通过lsof工具能够查看这个列表对系统监测以及排错将是很有帮助的。 输出信息含义 在终端下输入lsof即可显示系统打开的文件,因为 lsof 需要访问核心内存和各种文件,所以必须以 root 用户的身份运行它才能够充分地发挥其功能。 直接输入lsof部分输出为: COMMAND PID USER FD TYPE DEVICE SIZE/OFF NODE NAME init 1 root cwd DIR 8,1 4096 2 / init 1 root rtd DIR 8,1 4096 2 / init 1 root txt REG 8,1 150584 654127 /sbin/init udevd 415 root 0u CHR 1,3 0t0 6254 /dev/null udevd 415 root 1u CHR 1

端口使用情况

走远了吗. 提交于 2019-12-01 08:20:39
Linux 查看端口占用情况可以使用 lsof 和 netstat 命令。 lsof lsof(list open files)是一个列出当前系统打开文件的工具。 lsof 查看端口占用语法格式: lsof -i:端口号 实例 查看服务器 8000 端口的占用情况: # lsof -i:8000 COMMAND PID USER FD TYPE DEVICE SIZE/OFF NODE NAME nodejs 26993 root 10u IPv4 37999514 0t0 TCP *:8000 (LISTEN) 可以看到 8000 端口已经被轻 nodejs 服务占用。 lsof -i 需要 root 用户的权限来执行,如下图: 更多 lsof 的命令如下: lsof -i:8080:查看8080端口占用 lsof abc.txt:显示开启文件abc.txt的进程 lsof -c abc:显示abc进程现在打开的文件 lsof -c -p 1234:列出进程号为1234的进程所打开的文件 lsof -g gid:显示归属gid的进程情况 lsof +d /usr/local/:显示目录下被进程开启的文件 lsof +D /usr/local/:同上,但是会搜索目录下的目录,时间较长 lsof -d 4:显示使用fd为4的进程 lsof -i -U:显示所有打开的端口和UNIX