Personal tools

Auto-Recovery After a Power Failure

From Rivendell Wiki

Jump to: navigation, search

Configuring the server

Your server should be protected against power outages, but not everyone has the luxury of a generator backup. At the least a good UPS should provide for a clean shutdown. When power is restored, the following will automatically start RDAirplay and load the appropriate log:

  1. Set the BIOS to automatically power the computer on after a power failure.
  2. Set up the Linux workstation to automatically log in all the way straight to the desktop (i.e. don't require or else automatically provide the user credentials so that there is no logon prompt when the computer is powered up). This could be considered a security risk in some environments: a password protected screen saver may help mitigate the exposure.
  3. Place a shortcut that calls RDAirplay in the startup folder in KDE (or whichever desktop manager is used).
  4. In the shortcut (script, etc.), use the appropriate command-line switches for 'rdairplay' to load a log automatically. The usual variables (month, day, year, etc.) work as in Rivendell, since RD uses the standard variables used in the 'date' program in Linux. (See below.)

You may need to remove RDAirplay's lock file if RDAirplay complains with:

Multiple Instances Not Allowed

and if you are certain no other instance is running, you should remove the file ~/.rdairplaylock.

It may be that RDAirplay can not be made to start up in the middle of a long-form cart that should be playing. If the log consists primarily of carts that are all designed to have a non-hard-timed PLAY or SEGUE transition, you might have a problem getting the log to start back up, so you might consider putting in at least one hard-timed event per hour if the log allows it.

Example of the shortcut placed in the autostart directory

For reference, here's a shortcut that should be put into the <homedir>/.kde/Autostart/ directory on a Rivendell system that is designed to autostart RDAirplay after a power failure. It will display as an icon in a graphical environment, but this is what will display when you cat the file itself from the command line. (The shortcut is actually just a text file containing appropriate entries.)

Note particularly the "Exec" line below. The Rivendell log name is called "fri" and what the "|sed ..." stuff does is change all the upper-case characters to lower-case. (Of course, one could simply rename the logs, but that would be too easy.) Adapt the line to match your naming convention as necessary.

Also note the "Icon" entry: It will have to point to the location of your icons and RDUSER changed to the name of the user you run Rivendell as.

> cat ~/.config/autostart/rdairplay.desktop

[Desktop Entry]
BinaryPattern=
Categories=Qt
Comment=
Comment[en_US]=
Encoding=UTF-8
Exec=rdairplay  --log1=`date +%a|sed y/ABCDEFGHIJKLMNOPQRSTUVWXYZ/abcdefghijklmnopqrstuvwxyz/`:+
GenericName=Rivendell On-Air Playout
GenericName[en_US]=Rivendell On-Air Playout
Icon=/home/RDUSER/cvs/rivendell/icons/rivendell-32x32.xpm
MimeType=
Name=RDAirPlay
Path=
StartupNotify=true
Terminal=false
TerminalOptions=
Type=Application
X-DCOP-ServiceType=
X-KDE-SubstituteUID=false
X-KDE-Username=

(Many thanks to Sherrod Munday for the above procedure.)