Created
February 26, 2016 11:47
-
-
Save mfournier/ca6a1decd63db0ce8c67 to your computer and use it in GitHub Desktop.
sudo lsof | awk -f scan-processes.awk
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
{ | |
if ($4 ~ /^DEL$/) { | |
sub(".#prelink#.*", "", $8) | |
mappings[$8]++ | |
processes[$1]++ | |
} | |
} | |
END { | |
for (j in mappings) { | |
print "file",j,"has "mappings[j]" dangling reference(s)" | |
} | |
for (i in processes) { | |
print "process",i,"has "processes[i]" deleted mapping(s)" | |
} | |
print length(processes),"processes need restarting" | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment