[mythtv-users] 'service mythbackend start' fails on slave backend

Andrew Robinson awrobinson-ml at nc.rr.com
Fri Sep 28 00:11:56 UTC 2007


Nick Morrott wrote:
> On 27/09/2007, Andrew Robinson <awrobinson-ml at nc.rr.com> wrote:
>> I am trying to setup a slave backend and I have narrowed my problem down
>> to this. When I start mythbackend from a command line like
>> '/etc/init.d/mythbackend start', mythbackend starts up and connects to
>> the database just fine. However, when I use the 'service' command, ie,
>> 'service mythbackend start', mythbackend fails to connect to the
>> database on the master backend. Apparently when I use the 'service'
>> command, I do not get the environment required. I will keep on trying to
>> track this down. While I do, has anyone else encountered this and
>> figured out a solution? I am running Fedora 7 on the slave backend.
> 
> This is very much likely due to a bad $HOME variable. Which version of
> MythTV are you running, and how many copies of the mysql.txt do you
> have on your system? (You may have MythTV directories in /, /root and
> /home/mythtv. You need to ensure all mysql.txt contain the correct
> information for accessing the database.
> 

The .mythtv in the / directory was the solution. In the mysql.txt file 
there, DBHostName was set to "localhost". I changed it to the name of 
the master backend and 'service mythbackend start' worked. I had looked 
at the .mythtv directories in /home/mythtv and /root. I had not thought 
to look for one in /. Thanks!

I think the $HOME directory also explains how I did get it to work. I 
focused on these three lines in the /etc/init.d/mythbackend script:

   # Does not work on Red Hat, do to to missing audio/video groups.
#  cd $MYTHTV_HOME && daemon --user mythtv $binary $OPTIONS
   cd $MYTHTV_HOME && daemon $binary $OPTIONS

Despite the warning about Red Hat, I decided to try the version with 
"--user mythtv". I found the mythbackend program ran and connected to 
the database on the master backend, but it would not write to the log 
files. So I tried substituting "--user root" instead. With that, 
mythbackend ran, connected to the database, and wrote to the logs. I 
wasn't sure if there would be any unintended consequences, but hey, it 
worked. Myth finally acknowledge the tuners on the slave backend.

I think with your reply I understand what was happening. With "--user 
mythtv", I was accessing the mysql.txt in mythtv's home directory. 
Likewise with "--user root", I was accessing the mysql.txt file in 
root's home directory. With no "--user" option, I was accessing the 
mysql.txt file under the / directory. At the time, the DBHostName 
variable in that file was set to "localhost".

Thanks for the help!

Andrew Robinson


More information about the mythtv-users mailing list