I wrote a Perl script to grab info (from files such as /proc//stat, /proc//io, /proc//cmdline, ...) of every process on my Linux system periodically (say, every minute). However, when I ran this script, it sometimes hangs on processes that quick disappeared, especially those processes with small ID (due to wrapping around). I did add status checking of every info file before opening it. Anyone could shed some light? Thanks.
Take the 2-minute tour
×
Stack Overflow is a question and answer site for professional and enthusiast programmers. It's 100% free, no registration required.
SysRq-T
might create some overhead as depending on your console settings, it may hang for a few seconds. Don't do it on something that's HA-clustered. In that case, it's probably better to attach a kernel debugger live and look at the kernel-side stacktraces for your hung script directly; in RHELcrash
, that'd bebt <pid>
. More straightforward then as well. – FrankH. Jun 12 '13 at 10:22