[mythtv-users] mythbackend identity crisis!

Michael T. Dean mtdean at thirdcontact.com
Fri Dec 2 03:12:15 EST 2005

Gerald Schepens wrote:

> Michael T. Dean wrote:
>> Gerald Schepens wrote:
>>> I am having trouble with my mythbackend.  For some reason, it can 
>>> connect to my mysql database just fine when started manually, but 
>>> when started as a service, it attempts to connect as "mythtv" which 
>>> is not how I set it up.  Why does it think it needs to use different 
>>> credentials when it's started as a service and how do I fix it? 
>> Different user, different mysql.txt? 
> Not as far as I know.  All my mysql.txt are symlinked to the same one.

Which doesn't mean it's not the problem...

When starting a process as a service, environment variables that are 
"normally" there are not always available.  For example, the HOME 
environment variable may not be set, at which point you may expect that 
it's using ~mythtv/.mythtv/mysql.txt (or ~root/.mythtv/mysql.txt), when 
in fact it's using /.mythtv/mysql.txt (which doesn't exist, so it goes 
with the defaults--including username/password of mythtv/mythtv).

If that's truly the problem, how can you fix it?
    1) Set the HOME variable in your script.  (If you use this approach, 
you may need to set other variables, too, depending on what other 
"normal" settings you expect to be there.)
    2) Execute the script using a login shell, i.e.
su - mythtv -c "/usr/local/bin/mythbackend -d -l 
    3) ...


More information about the mythtv-users mailing list