Hi,
There was a nifty script someone posted a long time ago that would query
the database and use Riv macros to resume roughly where it left off. I
forgot who figured this out so credit goes out to mystery list poster
not me.
It worked quite well from what I remember although you may end up
replaying the event. I can't remember who posted this but effectively
you use MySQL and then send an LL command to rivendell to jump down the
list:
#!/bin/bash
#Credentials for Rivendell Database
#Edit these as required
user="rduser"
pass="CHANGE TO YOUR RD USER PASSWORD"
host="CHANGE TO YOUR DB HOST"
db="Rivendell"
#Get the current time
let h=$(date +%-k)*3600000
let m=$(date +%-M)*60000
let s=$(date +%-S)*1000
let ms=$h+$m+$s
echo "MS: "$ms
#Get the current date formatted for the log name you use
NOWDATE=$(date +%Y_%m_%d)
echo "NOWDATE: "$NOWDATE
#Get the actual log name my logs are 2014_07_14_LOG so change this
LOG_NAME=$NOWDATE"_LOG"
echo "LOG_NAME: "$LOG_NAME
#Get the row count from the DB based on the current time
let SQLRESULT=$(mysql --skip-column-names -u "$user" -p"$pass" -h "$host" "$db" -e
"select COUNT from $LOG_NAME where START_TIME >= $ms LIMIT 1";)-1
echo "SQLRESULT: "$SQLRESULT
#Send the RML command LL to load a log from the specified line
rmlsend LL\ 1\ $NOWDATE\ $SQLRESULT\!
All this script does it gets the current time and change it into
whatever your daily log names are. It then runs a MySQL query to count
how many lines of the log need to be skipped. Then we do an RML command
LL and tell it to load the log and skip to the line we should be at.
If you combine this script with pidof you can get the result you're after:
#!/bin/bash
while true; do
if [ "$(pidof rdairplay)" ]
then
#Airplay is running so do nothing
else
#Airplay isn't running so lets run the above script
#Copy in from the Credentials line down in here
fi
#Wait 1 second before checking again
sleep 1
done
Hope this makes some sense,
Wayne Merricks
The Voice Asia
On 14/07/14 13:11, Rob Landry wrote:
On Sun, 13 Jul 2014, Dan Gruner wrote:
Could someone point me in the direction of a script that will monitor
RDAirPlay and restart the application if it quits.
On occasions where I'm running a program such as a streaming encoder
that occasionally crashes, I'll start it from a script. The script
executes a while(1) loop (i.e. loop forever), then forks. The child
process starts the program while the parent waits. If the program
crashes, the child process terminates, whereupon the parent will fork
a new one and restart the program.
I've never done this with rdairplay. My principal concern would be
that rdairplay always starts at the beginning of a log (i.e. at
midnight), so if it dies at, say, 10 AM, the next thing listeners will
hear is the midnight top-of-hour ID and the first piece of music in
the midnight hour.
Some other automation systems -- AudioVault in particular -- will
resume where they left off, but I've never been able to get Rivendell
to do that.
Trying to simply restart RDAirPlay seems to always result in a
"Multiple Instances Not Allowed" error, which either requires the
service to be killed or the machine to be re-started.
I believe you'll find there's a file called .rdairplaylock; you need
to delete it before restarting rdairplay.
Rob
_______________________________________________
Rivendell-dev mailing list
[email protected]
http://caspian.paravelsystems.com/mailman/listinfo/rivendell-dev
_______________________________________________
Rivendell-dev mailing list
[email protected]
http://caspian.paravelsystems.com/mailman/listinfo/rivendell-dev