[an error occurred while processing this directive] [an error occurred while processing this directive][an error occurred while processing this directive] [an error occurred while processing this directive] [an error occurred while processing this directive] [an error occurred while processing this directive] (none) [an error occurred while processing this directive] [an error occurred while processing this directive] [an error occurred while processing this directive] [an error occurred while processing this directive] [an error occurred while processing this directive][an error occurred while processing this directive] [an error occurred while processing this directive][an error occurred while processing this directive] [an error occurred while processing this directive][an error occurred while processing this directive] [an error occurred while processing this directive] [an error occurred while processing this directive] [an error occurred while processing this directive] (none) [an error occurred while processing this directive] [an error occurred while processing this directive] [an error occurred while processing this directive][an error occurred while processing this directive]
 
[an error occurred while processing this directive] [an error occurred while processing this directive]
Skåne Sjælland Linux User Group - http://www.sslug.dk Home   Subscribe   Mail Archive   Forum   Calendar   Search
MhonArc Date: [Date Prev] [Date Index] [Date Next]   Thread: [Date Prev] [Thread Index] [Date Next]   MhonArc
 

Tip: find processen, der bruger et givent dir



Jeg er indimellem udsat for, at nogle processer blokerer for f.eks.
umount. Det er skide irriterende og jeg har indtil fornyligt ikke kunnet
finde ud af, hvem pokker der blokerede. Med det er ovre nu.

Lad os sige, at du har et dir (/usr/src/postgresql-7.2.1/) som du gerne
vil umounte:

# umount /usr/src/postgresql-7.2.1/
umount: /usr/src/postgresql-7.2.1: device is busy

Hvem pokker er synderne?

# ls -l /proc/*/cwd|grep /usr/src/postgresql-7.2.1/
lrwxrwxrwx    1 postgres postgres        0 Apr 30 03:49 /proc/3943/cwd ->
/usr/src/postgresql-7.2.1/
lrwxrwxrwx    1 postgres postgres        0 Apr 30 03:49 /proc/3944/cwd ->
/usr/src/postgresql-7.2.1/
lrwxrwxrwx    1 postgres postgres        0 Apr 30 03:49 /proc/3950/cwd ->
/usr/src/postgresql-7.2.1/

Aha!

# kill -9 3943 3944 3950
# umount /usr/src/postgresql-7.2.1/

Nogen kunne sikkert lave et script, der gjorde dræbningen nemmere:

perl -e '$dir=shift; map {m:/proc/(\d+)/cwd -> $dir[/\n]: and do {print
"$1\n"; kill 9, $1 } } `ls -l /proc/*/cwd`' /usr/src/postgresql-7.2.1/


/Ole
-- 
Linux user #194. Get counted: http://counter.li.org
http://ole.tange.dk



 
Home   Subscribe   Mail Archive   Index   Calendar   Search

 
 
Questions about the web-pages to <www_admin>. Last modified 2005-08-10, 19:28 CEST [an error occurred while processing this directive]
This page is maintained by [an error occurred while processing this directive]MHonArc [an error occurred while processing this directive] # [an error occurred while processing this directive] *