LinHES Forums http://forum.linhes.org/ |
|
R6Mythfilldatabase http://forum.linhes.org/viewtopic.php?f=6&t=19715 |
Page 1 of 1 |
Author: | weblst [ Sat Mar 21, 2009 12:00 am ] |
Post subject: | R6Mythfilldatabase |
Just did some logging to try and debug a mythfilldatabase issue and found it to be running as root. I have it configured via the mythtv interface and it runs at 1am everyday. This means the config files need to be installed in the root home directory among other things. Anyone have any ideas on how to run it as mythtv instead or root ???? |
Author: | tjc [ Sat Mar 21, 2009 12:19 am ] |
Post subject: | |
Use "su -". My old wrapper script says something like this to prevent exactly the problem you described and some other related ones, where the "fill_options" are set by the first half of the script: Code: case $(id -nu) in
root) su - mythtv -c "nice /usr/bin/mythfilldatabase $fill_options" result=$? ;; mythtv) nice /usr/bin/mythfilldatabase $fill_options result=$? ;; *) fatal "You must run this script at mythtv or root!" ;; esac |
Author: | weblst [ Sat Mar 21, 2009 3:58 pm ] |
Post subject: | |
TJC: Thanks for the reply and thats a great idea. I copied that to a script and tried it but it comes with an error while running. Mythfilldatabase says unable to run tv_grab_au --capabilities and complains about XMLTV being out of date. If I run the script as the mythtv user it is fine. I think it may be a permission problem with the grabber but mythfilldatabase runs fine if i run it manually. Here is my exact script any ideas would be appreciated: Code: case $(id -nu) in
root) su - mythtv -c "nice /usr/bin/mythfilldatabase $*" result=$? ;; mythtv) nice /usr/bin/mythfilldatabase $* result=$? ;; *) fatal "You must run this script at mythtv or root!" ;; esac |
Author: | tjc [ Sat Mar 21, 2009 8:00 pm ] |
Post subject: | |
This usually means that you're missing some environment setting, usually "PATH" or "HOME". I've described how to debug this many times before, so searching for posts that mention "env" with me as the author should provide the details. OBTW - Also search for "update_database.sh" which will lead you to the complete script. |
Author: | weblst [ Sun Mar 22, 2009 2:48 am ] |
Post subject: | |
Thanks again tjc I will look into it. ATM I have a cron that runs mythfilldatabase as mythtv but it would be cleaner to resolve the issue. |
Author: | Truck [ Sun Mar 22, 2009 5:10 pm ] |
Post subject: | |
For what it is worth I had the same problem so I hacked up the following quick script to run mythfilldatabase as mythtv. Code: #!/bin/sh # Format options for use in su -c "..." command OPTIONS="" while [ -n "$*" ] do OPTIONS="$OPTIONS '$1'" shift done su -c "mythfilldatabase $OPTIONS " mythtv Then I set the mythfilldatabase command under the automatically run mythfilldatabase setting screen (somewhere like LinHES->Myth Settings->Settings->General...) to use sudo to ensure the command was initially run as root (I noticed it is run as mythtv if you run it manually from the mythwelcome menu): Code: sudo mythtv_filldatabase
You can set the options and logfile in the settings screen to whatever you want and it should be handled appropriately by the script. |
Page 1 of 1 | All times are UTC - 6 hours |
Powered by phpBB® Forum Software © phpBB Group http://www.phpbb.com/ |