[RDD] RDairplay Stops

Patrick Schmalstig / WRRJ Radio xanaftp at gmail.com
Sat Dec 8 14:31:36 EST 2012


I apologize for the second email, but where it says
"media/Personal/rdairplay.log", you will need to change that to a valid
writable path.

On Sat, Dec 8, 2012 at 2:30 PM, Patrick Schmalstig / WRRJ Radio <
xanaftp at gmail.com> wrote:

> Here's the code:
>
> <?php
> $processid = shell_exec('pgrep rdairplay'); //check to see if rdairplay is
> running
> if ($processid == '') {
> sleep(5);
> $processid = shell_exec('pgrep rdairplay'); //failsafe to make sure
> rdairplay really isn't running
> if ($processid == '') {
> shell_exec("export DISPLAY=:0.0 && rdairplay >>
> /media/Personal/rdairplay.log 2>&1 &"); //if it isn't running, load it up
> on display 0.0 and send the process to a log file.
> while (shell_exec("pgrep rdairplay") == '') { //wait until rdairplay loads
> sleep(3);
> }
> sleep(10); //sleep another 10 seconds so that rdairplay is fully loaded
> before making the next move
> shell_exec("/usr/bin/rmlsend LL\ 1\ recoverlog\!"); //load the recovery log
> sleep(5); //give it 5 seconds to load
> shell_exec("/usr/bin/rmlsend PN\ 1\!"); //play the log
> sleep(5); //sleep 5 more seconds
> $christmas = shell_exec("export DISPLAY=:0.0 && zenity --info
> --text='Rdairplay crashed (and darkice was reset) and was brought back
> online at " . date('Y-m-d') . " " . time() . "'"); //use ZENITY to make a
> message box on display 0.0 saying rdairplay crashed and was brought back
> online. Unfortunately time outputs as a timestamp so you may need to
> convert that.
> }
> }
> ?>
>
> If you have any problems, please let me know. Again, paste into gedit or
> something, save as a php file, install the php client on Ubuntu if not
> installed already, create a cron job executing "php
> path/to/this/phpfile.php" every minute, and you should be okay.
>
> Please test this once by closing out rdairplay after the cron job was
> created. See if it loads after a couple minutes. If not please let me know.
> :)
>
> -Patrick
>
-------------- next part --------------
An HTML attachment was scrubbed...
URL: http://lists.rivendellaudio.org/pipermail/rivendell-dev/attachments/20121208/c09da926/attachment.htm 


More information about the Rivendell-dev mailing list