On Tue, 5 Jun 2012, Patrick Schmalstig / WRRJ Radio wrote:
> If you want my two cents as far as a silent monitoring script for mplayer... > I don't use mplayer but I use an internet streamer called darkice to stream > from JACK to the internet... and when the internet clucks out darkice > crashes. I've created a small php script which executes every minute. The > first command is "pgrep darkice". If the command returns a number, the > script assumes darkice is still running. If it returns nothing, it will > execute the same command two more times within 5 seconds of each try, to > lesson chances of a false positive. Finally, if all three times the command > returns nothing, the php script assumes darkice crashed and it gets to work. My approach to the same problem was to write a perl script that starts on boot and forks. The child process starts darkice, while the parent waits for it to terminate. If darkice crashes, the child terminates and the parent immediately loops and launches a new child process which restarts darkice. The parent process loops forever, so darkice can crash however many times and will always be restarted. Rob _______________________________________________ Rivendell-dev mailing list [email protected] http://lists.rivendellaudio.org/mailman/listinfo/rivendell-dev
