[mythtv-users] mythfilldatabase autorun config file location error
Michael T. Dean
mtdean at thirdcontact.com
Tue Oct 17 16:57:49 UTC 2006
On 10/17/06 09:56, Daniel Kristjansson wrote:
>On Sat, 2006-10-14 at 16:26 +0100, Neil Sedger wrote:
>
>
>>Michael T. Dean wrote:
>>
>>
>>>Because the environment from which this is being run doesn't have a HOME
>>>environment variable defined.
>>>
>>>
>>Indeed. How odd. I thought that Fedora initscripts would automatically pick up the user's (root) environment. A quick test shows it doesn't even have $USER!
>>I've edited the initscript to hardcode the HOME var as you suggested, thanks.
>>I'd have thought this problem would happen to more people though, I haven't seen it mentioned in the docs, install guide or FAQ.
>>
>>
>I would think very few people run mythfilldatabase as root..
>
>Too many people do something crazy like run mythbackend or mythfrontend
>as root, but I've never seen anyone recommend running mythfilldatabase
>that way.
>
Of course, if running (the master) mythbackend as root and if MythTV is
set to automatically run mythfilldatabase, mythfilldatabase is run as
root. :)
The most common reason to be lacking a HOME environment variable is
because an init script (which is not executed under a login shell)
starts mythbackend and doesn't go to the trouble of setting up the
environment correctly. Those without a HOME environment variable tend
to end up with /.qt and /.mythtv directories (off the root of the fs)
because the HOME expands to nothing (in MythContext::GetConfDir()). In
this case--whether using XMLTV or DataDirect--mythfilldatabase will
download the channel icons into /.mythtv/channels directory (off the
root of the filesystem).
Another issue caused by running mythbackend as root is the lack of an
XMLTV configuration file (for XMLTV users). Often, the user will
configure XMLTV as user mythtv (the user running mythfrontend) or
sometimes even as the root user, but from a login shell (with a HOME
environment variable). In doing so, the XMLTV configuration file is
written to the user's home directory. Then, when mythfilldatabase runs
automatically (by the mythbackend process started in an environment
lacking a HOME), if often fails because it's lacking an XMLTV
configuration file.
IMHO, we shouldn't be looking through random directories for
configuration information when a HOME environment variable doesn't exist
(even hard-coding in paths like /home/{root,mythtv} and /root. So, we
just need to ensure that users configure their environments appropriately.
I don't know how any of the distros set things up, but if, as the OP
suggests, the FC init scripts don't set the HOME environment variable,
it means that a large number of FC users are probably relying on /.qt
and /.mythtv directories for their mythbackend/mythfilldatabase
configurations. If Axel were to change the init scripts to specify a
HOME, then those users who had gotten configuration information into
directories of the root filesystem would no longer be using that
information (and would, therefore, have to be taught to move their
configuration information). So, changing the scripts and not changing
the scripts both have their benefits.
But, as you were saying, running mythfilldatabase as root is not a good
idea. So, by extension, figuring out how to run mythbackend as non-root
is a good idea. :)
Mike
More information about the mythtv-users
mailing list