釋放 lsof 的力量

Gentoo 管理、通用套件相關問題 (如 iptables、apache、*sql、*ftpd...) 請在此討論。

版主: Forums Team

釋放 lsof 的力量

文章pokkys » 週五 2月 27, 2009 2:01 am

emerge lsof

常常,目錄umount不掉。
# umount /mnt/cdrom
umount: /mnt/cdrom: device is busy
umount: /mnt/cdrom: device is busy

看看到底是誰在用阿!
# lsof | grep /mnt/cdrom
bash 6453 larry cwd DIR 7,0 2048 1856 /mnt/cdrom
su 15774 root cwd DIR 7,0 2048 1856 /mnt/cdrom

常常,看到一些port不知道是誰開的。
# lsof -i TCP:25
OMMAND PID USER FD TYPE DEVICE SIZE NODE NAME
master 17408 root 12u IPv4 632942 TCP localhost:smtp (LISTEN)

master是甚麼阿?
# ps auxww|grep master
root 17408 0.0 0.0 5220 1516 ? Ss 06:19 0:00 /usr/lib/postfix/master

他parent是誰?
# lsof -R -i TCP:25
COMMAND PID PPID USER FD TYPE DEVICE SIZE NODE NAME
master 17408 1 root 12u IPv4 632942 TCP localhost:smtp (LISTEN)
PPID = 1,看一下祖譜吧。
# pstree 1
init–6*[agetty]
–amd
–cron
–master—pickup
– –qmgr
–mysqld—16*[{mysqld}]
–ntpd
–portmap
–rpc.mountd
–rpc.rstatd
–rpc.statd
–squid—squid—30*[redirect.pl]
- ??unlinkd
–2*[sshd???sshd---tcsh]
–sshd—2*[sshd--sshd---tcsh]
- –sshd—sshd—tcsh—pstree
–syslog-ng
–udevd
–ypbind—2*[{ypbind}]
頭像
pokkys
 
文章: 94
註冊時間: 週六 12月 17, 2005 12:01 am
來自: 台灣台南

回到 Gentoo 服務與管理

誰在線上

正在瀏覽這個版面的使用者:沒有註冊會員 和 10 位訪客

cron