Test if program is ever running (not sleeping) over a time period?
I promise I have searched on this high and low (not just on ubuntuforums) and can't seem to find an answer. Here is the scenario:
I am using mplayer to run a slideshow of jpg images all day. (Yes I know there is feh and fbi, but this is being done without X against the framebuffer inside gnuscreen, so fbi won't work, and mplayer "does")
Each image is on screen for @ 60 seconds then changes to the next.
Watching htop, mplayer is sleeping (S) for most of the time, then when the time comes to change the image it starts running (R) then goes back to sleep (S).
My problem is that at some point each day (random) mplayer freezes up, and stops changing images, even though it still displays an image on screen. htop reports that mplayer is (S).
How can I run a monitor like "top" on mplayer for say a two minute period to check if mplayer ever goes to (R) (or has an increase in CPU usage) ?
I can then script to restart mplayer if no (R) is found.
Last edited by Merrattic; May 12th, 2013 at 04:39 PM.
The best things in life are free, so what are we paying for?