From 521fd807ca30fcd17a3c9e119807e76a13231356 Mon Sep 17 00:00:00 2001 From: Pascal Rigaux Date: Mon, 3 Nov 2003 09:57:15 +0000 Subject: look into /proc/*/maps for more busy files --- move/tools/busy-files | 16 ++++++++++++++-- 1 file changed, 14 insertions(+), 2 deletions(-) (limited to 'move/tools') diff --git a/move/tools/busy-files b/move/tools/busy-files index 476a2dc67..5356b3684 100755 --- a/move/tools/busy-files +++ b/move/tools/busy-files @@ -2,8 +2,20 @@ use MDK::Common; -print "$_\n" foreach uniq (map { +my @pids = grep { $_ ne $$ && /^(\d+)$/ } all('/proc'); + +my @l = map { grep { $_ && !m!^(/proc/|/dev/|pipe:|socket:)!; } map { readlink($_) } "/proc/$_/exe", glob_("/proc/$_/fd/*"); -} grep { $_ ne $$ && /^(\d+)$/ } all('/proc')); +} @pids; + +push @l, grep { $_ } map { (split)[5] } map { cat_("/proc/$_/maps") } @pids; + +foreach (uniq @l) { + if ($ARGV[0] eq '--server') { + s!/image_(always|boot)!/tmp/live_tree!; + s!/image_raw/live_tree!/tmp/live_tree!; + } + print "$_\n"; +} -- cgit v1.2.1