Using Multiple Binaries

From MythTV Official Wiki
Jump to: navigation, search

If you need to run multiple versions of the mythtv binaries, you can use the following method to switch between the two.


Method 1

Yes it can be done, and is relatively straightforward. I do this so I can switch between versions to test and code against each one.

What i do is to compile them with different prefixes. ie

fixes/0.27:
--prefix=/usr/local/myth-0.27
and for convenience of my wrapper scripts (more on these in a bit)
I symlink /usr/local/myth-prod -> /usr/local/myth-0.27

master:
--prefix=/usr/local/myth-git

Then build each one in turn and install it

Then I have wrapper scripts which I stick in /usr/local/bin and name appropriately: mythbackend-prod, mythbackend-git etc

They are all basically the same

Example: /usr/local/bin/mythbackend-prod
--------
#!/bin/sh

PATH=/usr/local/myth-prod/bin:$PATH
LD_LIBRARY_PATH=/usr/local/myth-prod/lib:$LD_LIBRARY_PATH
MYTHCONFDIR=$HOME/.mythtv-prod/
PYTHONPATH=/usr/local/myth-prod/lib/python2.7/site-packages

export PATH LD_LIBRARY_PATH MYTHCONFDIR PYTHONPATH

exec /usr/local/myth-prod/bin/mythbackend $@
--------

Some key items to note

PATH obvious, where to find the binaries

LD_LIBRARY_PATH as per PATH, where to find the libraries

MYTHCONFDIR moves where the config files (normally in ~/.mythtv) live. Different versions, use different databases which means different config files!

PYTHONPATH, like PATH means the python bits we install will be found. This allows things like the metadata grabbers to work

On the database side, I have 2 different databases named mythprod and mythdev. I on purpose do not use mythconverg, so that I can be explicit about which database to use, and anything being stupid and just using mythconverg will be caught.

I run both a prod (fixes/0.27) and dev (master) backend on the same server. For tuners I have 1 dual DVB-T and 1 dual DVB-S2, so i split each tuner, and use 1 of each type of input for prod and dev (so they have identical tuner setups)

My frontends use exactly the same setup, with the same scripts (literally just change mythbackend to mythfrontend in the script)

Method 2

There are ways. That's how I do here.

First make sure the binaries are installed in two different paths. that means you can't use 0.27 and 0.28 binary packages you'll have to compile one yourself

Eg. ./configure --prefix=/something/that/is/different/to/the/other/install

then make / make install

The easiest then is to use a different user to run it so you have no conflicting mythtv config: to run it: LD_LIBRARY_PATH=/something/that/is/different/to/the/other/install/lib /something/that/is/different/to/the/other/install/mythfrontend